Skip to content

Add AccessGrant and CalendarAvailability ontology schemas - #1095

Merged
coodos merged 5 commits into
mainfrom
codex/add-access-grant-calendar-availability
Jul 29, 2026
Merged

Add AccessGrant and CalendarAvailability ontology schemas#1095
coodos merged 5 commits into
mainfrom
codex/add-access-grant-calendar-availability

Conversation

@AlexTourski

@AlexTourski AlexTourski commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds two proposed W3DS JSON Schema draft-07 ontologies:

  • AccessGrant for canonical owner-to-grantee authorization and non-authoritative discovery references.
  • CalendarAvailability for explicit owner-defined booking windows.

The schemas use newly generated UUIDv4 identifiers:

  • AccessGrant: 15d24c04-a4f3-4e45-a00e-0123926fbc87
  • CalendarAvailability: a92c3675-dbc8-44f6-b24e-520eeadb8864

This 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

  1. Is the canonical/reference AccessGrant pattern appropriate for cross-eVault discovery?
  2. May a certified post-platform create a non-authoritative reference in a grantee's eVault?
  3. Should raw AccessGrant and CalendarAvailability records remain owner-only under the current combined read/write ACL semantics?
  4. Are namespaced permissions such as calendar:viewBusy acceptable?
  5. Where should delegated actor and authorizing grant provenance live: MetaEnvelope metadata, audit records, or CalendarEvent fields?
  6. Does grant creation/revocation require an owner signature flow?
  7. What shared provisional-hold and atomic compare-and-create mechanism should prevent double booking?
  8. Are draft-07 conditional keywords (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

  • New Features
    • Added formal, strict validation contracts for access grants, including canonical vs reference shapes.
    • Enforced conditional rules for recipients, delegation behavior, permission/resource patterns, lifecycle status, and revocation timestamps.
    • Added a calendar availability schema with booking policies, verification hold timing, per-day limits, cancellation handling, and consistent audit fields.
    • Schemas now reject unsupported fields and require values to match defined formats, types, and allowed ranges.

Type of change

  • New ontology schemas
  • Runtime behavior change
  • Deployment change

Testing

  • Both files parse as valid JSON.
  • Repository CI: Check Format, Check Code, and Build All Packages.
  • Review follow-up commits add lifecycle-state consistency constraints.
  • The cross-field invariant startDate < endDate is documented but still requires maintainer guidance because JSON Schema draft-07 cannot enforce property ordering.

Checklist

  • Changes are limited to ontology schema files.
  • No existing ontology IDs were modified.
  • No runtime, infrastructure, credential, or user-data changes are included.
  • Automated review comments were addressed or answered.
  • Maintainer semantic review completed.
  • Live Ontology publication process confirmed.

Related issue: none; this PR originates from the Calex integration proposal.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@AlexTourski, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d78d2761-bc58-4f6c-8b3d-7f0f5741aab0

📥 Commits

Reviewing files that changed from the base of the PR and between efb66c8 and 3e6d44c.

📒 Files selected for processing (1)
  • services/ontology/schemas/calendarAvailability.json
📝 Walkthrough

Walkthrough

Adds JSON Schema contracts for AccessGrant and CalendarAvailability, including field constraints, required properties, variant validation, lifecycle conditions, and restrictions on undeclared properties.

Changes

Access grant schema

Layer / File(s) Summary
AccessGrant shared contract
services/ontology/schemas/accessGrant.json
Defines schema metadata, shared fields, validation constraints, and required properties for AccessGrant.
AccessGrant variants and conditionals
services/ontology/schemas/accessGrant.json
Validates canonical and reference grant shapes, conditional grantee fields, revoked timestamps, and disallows undeclared properties.

Calendar availability schema

Layer / File(s) Summary
CalendarAvailability validation
services/ontology/schemas/calendarAvailability.json
Defines fields, required properties, booking-policy conditions, cancellation conditions, and additional-property restrictions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: coodos

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the two new ontology schemas added in this PR.
Description check ✅ Passed The description covers the required sections well, with clear summary, type, testing, and checklist details.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-access-grant-calendar-availability

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coodos
coodos marked this pull request as ready for review July 27, 2026 07:37
@coodos
coodos self-requested a review as a code owner July 27, 2026 07:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8a4fc83 and 181ced8.

📒 Files selected for processing (2)
  • services/ontology/schemas/accessGrant.json
  • services/ontology/schemas/calendarAvailability.json

Comment thread services/ontology/schemas/accessGrant.json
Comment thread services/ontology/schemas/accessGrant.json
Comment thread services/ontology/schemas/calendarAvailability.json Outdated
Comment thread services/ontology/schemas/calendarAvailability.json
@coodos
coodos merged commit 6d1b8b6 into main Jul 29, 2026
4 checks passed
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