Skip to content

Phase 3 — Scheduling & conflict avoidance (killer scenario) #978

Description

@seonghobae

Buyer outcome

Naruon's first unmistakable buyer workflow is not another calendar view. It is a trustworthy commitment engine that sees customer-owned calendars and communication evidence, distinguishes confirmed obligations from tentative or desired plans, resolves conflicts without leaking private reasons, and changes the authoritative provider only after an authorized correction/approval boundary.

This issue is the canonical implementation contract for scheduling and commitment closure under #1428.

Exact protected-branch baseline — 2026-08-20

Protected develop@c9bfba2dc2063b82741686a3b3120a66c269ab27 already provides:

  • signed, scoped Calendar workspace reads and writeback intents;
  • opaque server-authoritative CalDAV source selection;
  • explicit execute_provider=true execution;
  • ETag/If-Match evidence before connector dispatch;
  • durable encrypted provider-write retry rows, exponential backoff, exhausted state, signal events, and aggregate queue observability.

It does not yet establish a shipped first-class typed Event/Commitment domain with status-weighted conflict decisions, organizer-vs-attendee iTIP semantics, complete free/busy/resource scheduling, or buyer-visible resolution evidence. The planning document and linked issues describe those as new/planned work. Refetch exact branch and overlapping PRs before implementation.

Domain model

Use normalized temporal objects such as:

event_record
event_occurrence
commitment_record
commitment_status
participant_assignment
organizer_assignment
resource_calendar
availability_window
provider_event_mapping
provider_revision
conflict_assessment
conflict_candidate
resolution_decision
resolution_evidence
schedule_correction
calendar_sync_cursor

Required distinctions:

  • event occurrence is not the same as a person's commitment to attend;
  • organizer and attendee direction are separate roles;
  • confirmed, tentative, desired, declined, and cancelled are not interchangeable;
  • series definition, recurrence exception, occurrence, and detached provider copy are separate facts;
  • event time, provider-recorded time, Naruon-observed time, and decision time remain distinct;
  • one person, resource, or event may belong to multiple projects, bands, organizations, and privacy contexts.

Conflict and resolution contract

  1. confirmed > tentative > desired is a default evidence-backed priority, not the only rule.
  2. Naruon never silently breaks or rewrites a confirmed commitment.
  3. Travel time, location, setup/teardown, availability, organizer role, paid/non-refundable evidence, resource capacity, and tenant policy may affect the decision.
  4. Group or norm-group patterns are priors only; they must not be imputed onto an individual without individual evidence.
  5. A private fact may cross a context boundary only as the consented necessary consequence, such as unavailable, never the hidden reason.
  6. Every recommendation exposes the selected resolution, alternatives behind it, evidence, confidence/calibration, affected provider objects, and one-step correction/hold.
  7. Provider mutation is separate from model judgment and requires current authorization, source capability, confirmation policy, and conflict-safe provider revisions.

Protocol and synchronization requirements

  • CalDAV collections, calendar-query/report behavior, recurrence, VTIMEZONE, free/busy, and calendar-access semantics must be covered with real interoperability fixtures.
  • Scheduling messages use the applicable iTIP/iMIP organizer/attendee method and sequence semantics; REQUEST, REPLY, CANCEL, counter-proposals, and organizer changes must not be flattened into generic CRUD.
  • CalDAV Scheduling support follows server capability discovery and scheduling extensions; implementations must not fabricate support when a provider lacks it.
  • Collection synchronization uses provider sync tokens where available and falls back only through a documented bounded reconciliation path.
  • ETag/If-Match and scheduling-tag preconditions are preserved according to provider capabilities; a stale remote object produces a conflict outcome rather than an overwrite.
  • Resource/room calendars support capacity, permissions, availability, tentative holds, decline reasons appropriate for disclosure, and release of abandoned holds.
  • Timezone, daylight-saving transitions, floating time, all-day events, leap-day recurrence, exceptions, and provider normalization are tested explicitly.

End-to-end scenarios

Band-rehearsal double booking

confirmed paid rehearsal
+ desired partner event RSVP
→ one resolved recommendation preserving the confirmed commitment
→ private context remains segregated
→ user can correct/hold
→ provider action executes only after approval and current revision check

Organizer RSVP aggregation

  • aggregate attendee replies by UID/sequence/organizer authority;
  • do not treat a forwarded invitation or unrelated calendar copy as organizer truth;
  • surface missing/ambiguous replies and delivery evidence.

Find-time and room booking

  • calculate mutual free/busy across authorized sources and working-hour policies;
  • include travel/setup buffers and room/resource constraints;
  • create bounded holds, confirm exactly once, and release failed/expired holds;
  • retry safely without duplicate events or room reservations.

Approval-to-travel coordination

  • an authoritative leave/travel approval can enable downstream candidate events;
  • later approval revocation or schedule change invalidates stale recommendations;
  • no medical, relationship, or other private reason is copied into the work calendar.

Reliability and audit

  • every provider command has an idempotency identity and immutable decision/source revision receipt;
  • retry, exhaustion, cancellation, late provider success, duplicate provider event, and reconciliation states are explicit;
  • a late response cannot overwrite a newer correction or provider revision;
  • the user can inspect whether a result was intent-only, dispatched, acknowledged, retried, reconciled, or failed;
  • metrics/logs/traces omit event descriptions, attendees, credentials, and private reasons unless a separately authorized diagnostic policy permits a narrow sample.

TDD acceptance evidence

  • recurrence and detached-instance property tests;
  • timezone/DST/floating/all-day golden fixtures;
  • organizer/attendee iTIP sequence and replay tests;
  • provider sync-token invalidation and full-reconciliation tests;
  • concurrent booking/hold atomicity and duplicate-command tests;
  • ETag/scheduling-tag stale-write tests;
  • multi-calendar, multi-tenant, and multiple-membership isolation;
  • conflict decisions with confirmed/tentative/desired evidence and explicit abstention;
  • privacy bridge tests proving only the necessary consequence crosses contexts;
  • connector offline/retry/exhaustion/late-success reconciliation;
  • real CalDAV/CardDAV interoperability profile against at least two supported servers;
  • keyboard, screen-reader, and exact-value UI tests;
  • production statement/branch coverage and public API docstrings 100% for owned code;
  • unchanged exact-head CI/security/coverage/container/provenance/review/workflow gates.

Done

Close only when a buyer can connect authorized customer calendars, receive a source-cited conflict resolution, approve or correct it, execute an idempotent revision-safe provider action, and inspect durable success/retry/conflict evidence without a confirmed obligation being silently broken or a private reason being disclosed.

Primary standards

Related work


Roadmap item — CWL Project #1 (naruon Platform Roadmap). Phase P3 · Component naruon. Spec: #974 (docs/planning/naruon-platform-plan.md).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: apiAPI, protocol, event, or external contractarea: authAuthentication, authorization, identity, or tenant isolationarea: ci-cdCI, GitHub Actions, checks, release, or supply chainarea: ui-uxFrontend, interaction, design, or user experienceenhancementNew feature or requestpriority: mediumNormal-priority or P2 workscope: product-gapCustomer-visible product gapstatus: triagedOpen issue has an organization taxonomy assignmenttype: featureNew or expanded product capability

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions