Add AccessGrant and CalendarAvailability ontology schemas - #1095
Conversation
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds JSON Schema contracts for ChangesAccess grant schema
Calendar availability schema
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@services/ontology/schemas/accessGrant.json`:
- Around line 241-264: Add a complementary else branch to the conditional
governing revokedAt for non-reference grants: when status is "active", constrain
revokedAt to null, while preserving the existing date-time validation for
revoked grants in the conditional around isReference and status.
- Around line 82-84: Update the delegationAllowed definition and its related
oneOf schemas, including CanonicalAccessGrant and AccessGrantReference, so the
schema accurately reflects whether delegation is supported: allow true values
through the applicable branch if delegation is intended, or remove the
authoritative required field when delegation is unavailable. Ensure no branch
simultaneously requires delegationAllowed to be false while another forbids the
key.
In `@services/ontology/schemas/calendarAvailability.json`:
- Around line 83-89: Update the calendar availability schema’s lifecycle
validation around the status and cancelledAt definitions so active records
require cancelledAt to be null. Add the corresponding else branch while
preserving the existing cancellation-timestamp requirement for non-active
states.
- Around line 15-21: Update the calendar availability record-validation layer
for the startDate and endDate fields to parse both date-time values and reject
records where endDate is less than or equal to startDate. Preserve the existing
schema property validation while enforcing that availability windows are
strictly forward-moving.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b889e48f-59af-4d45-92c2-abe06fd34cb1
📒 Files selected for processing (2)
services/ontology/schemas/accessGrant.jsonservices/ontology/schemas/calendarAvailability.json
Summary
Adds two proposed W3DS JSON Schema draft-07 ontologies:
AccessGrantfor canonical owner-to-grantee authorization and non-authoritative discovery references.CalendarAvailabilityfor explicit owner-defined booking windows.The schemas use newly generated UUIDv4 identifiers:
15d24c04-a4f3-4e45-a00e-0123926fbc87a92c3675-dbc8-44f6-b24e-520eeadb8864This PR is ready for maintainer review. Calex will not write records using these schema IDs until W3DS maintainers approve the model and merge/register the schemas.
Motivation
Calex needs interoperable records for calendar visibility, delegated event operations, explicit availability windows, and public booking policy without introducing a local authorization database or copying authoritative calendar data outside users' eVaults.
Maintainer questions / blockers
calendar:viewBusyacceptable?if/then,const) supported by the deployed Ontology validation path?Scope
Only two new files under
services/ontology/schemas/are added. No existing schema, runtime service, workflow, or deployment configuration is changed.Summary by CodeRabbit
Type of change
Testing
startDate < endDateis documented but still requires maintainer guidance because JSON Schema draft-07 cannot enforce property ordering.Checklist
Related issue: none; this PR originates from the Calex integration proposal.