Skip to content

Conversation

@IanMayo
Copy link
Member

@IanMayo IanMayo commented Jan 23, 2026

Summary

  • Add SYSTEM kind to FeatureKindEnum for storing non-spatial application state as GeoJSON Features with geometry: null
  • Implement three state variants: temporal viewport, spatial viewport, and selection state
  • Generate validated Pydantic, TypeScript, and JSON Schema outputs from LinkML master
  • Add comprehensive fixture-based validation tests (valid + invalid cases)

Changes

Schema Changes

  • Add SYSTEM to FeatureKindEnum in common.yaml
  • Add SystemStateTypeEnum (temporal, spatial, selection) in common.yaml
  • Add SystemStateProperties class with variant-specific fields in geojson.yaml
  • Add SystemState feature class with state.* ID pattern validation

Test Fixtures

  • system-state-temporal-01.json - Time viewport state
  • system-state-spatial-01.json - Map viewport state (bbox, zoom, center)
  • system-state-selection-01.json - Selected feature IDs
  • system-state-invalid-geometry.json - Tests non-null geometry rejection
  • system-state-invalid-id.json - Tests ID pattern validation

Documentation

  • Updated README.md with SYSTEM feature usage examples

Evidence

Test Results

Metric Value
Total Tests 124
Golden Fixture Tests 53
SYSTEM Fixtures 5 (3 valid, 2 invalid)
Warnings 6 (pre-existing LinkML limitation)

Key scenarios verified:

  • Valid temporal, spatial, and selection fixtures pass Pydantic validation
  • Invalid fixtures correctly rejected (non-null geometry, wrong ID pattern)
  • All existing tests pass (no regressions)

Usage Example

from debrief_schemas import SystemState, SystemStateProperties

temporal_state = SystemState(
    type="Feature",
    id="state.temporal",
    geometry=None,
    properties=SystemStateProperties(
        kind="SYSTEM",
        state_type="temporal",
        start_time="2024-01-15T09:00:00Z",
        end_time="2024-01-15T17:30:00Z"
    )
)
Sample Temporal Viewport JSON
{
  "type": "Feature",
  "id": "state.temporal",
  "geometry": null,
  "properties": {
    "kind": "SYSTEM",
    "state_type": "temporal",
    "start_time": "2024-01-15T09:00:00Z",
    "end_time": "2024-01-15T17:30:00Z"
  }
}
Sample Spatial Viewport JSON
{
  "type": "Feature",
  "id": "state.spatial",
  "geometry": null,
  "properties": {
    "kind": "SYSTEM",
    "state_type": "spatial",
    "bbox": [-5.5, 49.5, 1.5, 55.0],
    "zoom": 8.5,
    "center": [-2.0, 52.25]
  }
}

Test Plan

  • All 124 Python tests pass
  • TypeScript compilation succeeds
  • JSON Schema validation tests pass
  • Valid SYSTEM fixtures validate correctly
  • Invalid SYSTEM fixtures are rejected with appropriate errors
  • No regressions in existing fixture tests

Related

  • Spec: specs/022-system-kind-discriminator/spec.md
  • Tasks: specs/022-system-kind-discriminator/tasks.md
  • Evidence: specs/022-system-kind-discriminator/evidence/

Defines schema extension for storing non-spatial system state
(viewports, selections) as GeoJSON Features with null geometry.

Resolves: #76
Phase 0: research.md with design decisions
Phase 1: data-model.md, quickstart.md
Phase 2: planning-post.md, linkedin-planning.md

Ready for /speckit.tasks
29 tasks across 6 phases:
- Phase 1: Setup (2 tasks)
- Phase 2: Foundation - schema changes (9 tasks)
- Phase 3: US1 - viewport state (4 tasks)
- Phase 4: US2 - selection state (2 tasks)
- Phase 5: US3 - validation tests (3 tasks)
- Phase 6: Polish + PR (9 tasks)

Ready for /speckit.implement
Add SYSTEM value to FeatureKindEnum for storing application state
(viewports, selections) as GeoJSON Features with null geometry.

- Add SystemStateTypeEnum (temporal, spatial, selection)
- Add SystemStateProperties with variant-specific fields
- Add SystemState feature class with state.* ID pattern
- Add valid fixtures for all three state variants
- Add invalid fixtures for geometry/ID validation
- Regenerate Pydantic, TypeScript, JSON Schema outputs
- Update README with SYSTEM feature documentation

All 124 tests pass. 53 golden fixture tests cover SYSTEM features.
Per design decision, SYSTEM features use Point geometry with empty
coordinates array rather than geometry: null. This provides a
consistent geometry type while still indicating non-spatial data.

- Add GeoJSONEmptyPoint class with maximum_cardinality: 0
- Update SystemState to use GeoJSONEmptyPoint
- Update all fixtures and documentation
@IanMayo IanMayo merged commit f89d176 into main Jan 23, 2026
5 checks passed
@IanMayo IanMayo deleted the 022-system-kind-discriminator branch January 23, 2026 18:06
IanMayo pushed a commit that referenced this pull request Feb 11, 2026
Vega-Lite based results viewing infrastructure: renderer component,
tabbed bottom panel, logical result ID registry, custom editor for
drag-to-float, and auto-refresh. Absorbs E03 #83 into E04 #89.
Updates E03 cross-epic dependencies (only #82 and #84 need E04).

https://claude.ai/code/session_015jzC8noATYLoama7VdveuR
IanMayo pushed a commit that referenced this pull request Feb 11, 2026
Tools output standard result datasets (existing schema), not Vega-Lite
specs. A transformer in E04 #85 converts datasets to Vega-Lite specs.
This removes #82's dependency on E04 — all E03 tools (#78-082) can
now proceed independently of results visualization infrastructure.

https://claude.ai/code/session_015jzC8noATYLoama7VdveuR
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.

1 participant