feat: add deterministic schedules to lodging cancellation policies - #808
Conversation
Implements Universal-Commerce-Protocol#807 as a stacked draft on Universal-Commerce-Protocol#780.
Addresses pre-PR review findings for Universal-Commerce-Protocol#807.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@googlebot rescan |
|
@jingyli, could you point me to an engineer implementing a UCP Lodging consumer who might be open to a small interoperability test of the schedule proposed in #807 and this draft? I can help adapt one synthetic or publicly shareable lodging policy fixture and contribute a focused integration patch to select the applicable cancellation terms at a supplied instant, including cutoff boundaries and fallback behavior. This would remain pre-purchase disclosure only, with no payment/refund execution or inferred monetary bases. The aim is to test the proposal against a consumer implementation beyond the executable vectors here. A pointer to the right contact or venue would be appreciated. This is exploratory feedback, not a dependency for #780. |
Description
Adds an optional cancellation
scheduleto the Lodging policy introduced by#780, so a Platform can select the applicable cancellation terms at an explicit
instant. For example, a booking can offer a full refund before its 48-hour
cutoff and select a one-night penalty exactly at that cutoff.
The schedule contains an absolute anchor, ordered relative cutoffs, and
percentage, fixed-fee, or shared-measure outcomes. The required
refundabilitysnapshot and human-readable
descriptionremain. The change implements #807and is limited to buyer-initiated, pre-purchase policy disclosure.
Stacked PR status
lodging/bookingmainand re-verify the diffBehavior and compatibility
scheduleis optional and response-only; existing classification-onlypayload shapes remain valid.
refundabilityis the Business's authoritative response-generation summary;explicit-instant evaluation selects a schedule outcome without extrapolating
that snapshot or guessing a monetary basis.
and 86400-second days. Calendar validity and ordering are checked before
selection; unsupported timestamps and invalid schedules fall back to prose.
unambiguous monetary basis. Fixed fees use the root Booking currency.
Policy targeting alone does not imply multiplication by matched-room count.
purchase-relative cooling-off periods, or calendar-based durations.
Executable vectors
scripts/fixtures/lodging_cancellation_schedule.jsoncontains portable inputsand expected selection/fallback metadata. The test-only oracle in
scripts/test_cancellation_schedule.pychecks 52 selection/fallback cases and 26schema expectations using the official schema tool and exact arithmetic.
It also checks 3 local-policy derivations and 8 complete outcome assertions.
Coverage includes cutoff equality, offsets/DST, fractional instants, equivalent
and reversed durations, invalid calendar dates, malformed unselected outcomes,
unknown selected/unselected kinds, trailing newlines, and a POSIX leap-boundary
case. It does not calculate money, infer refundability, or resolve targeting.
The suite is wired into
docs.ymland the local pre-commit configuration.Public synthetic policy feedback
The synthetic hotel policy supplied in #780
is now represented by exact-boundary Phoenix cases. Derived New York spring/fall
examples separately verify local-calendar-to-instant resolution with IANA timezone
data before checking elapsed-offset selection. These are test-only examples of
unambiguous local times, not a new policy-template wire format or general compiler.
The fixtures distinguish symbolic one-night terms from a Business-resolved fixed
fee of 15000 minor units in root Booking currency USD. The latter carries a concrete
amount, not a machine-readable room-rate/tax basis; that representation gap remains
open. No schema fields or selection semantics changed in this follow-up.
Independent agent-disclosure study fixtures
Commit 365329a
adds 10 synthetic policy scenarios and 36 evaluation instants for paired
classification-plus-prose / schedule-added agent experiments:
The cases cover Phoenix and New York DST boundaries, multiple tiers,
non-refundable terms, symbolic outcomes without a monetary basis, malformed
schedules, and a prose/schedule conflict probe. Agent-visible data is separated
from held-out expectations. Conflict detection is exploratory; it does not
introduce a requirement to parse all legal prose for contradictions.
These are experiment inputs, not model results, official conformance tests,
or evidence of proposal approval. No customer agreements are included.
No wire schema or selection semantics changed.
Local validation for this follow-up: 10 scenarios, 36 evaluations, and 10
mutation checks pass; all repository pre-commit hooks, existing cancellation
vectors, validator unit tests, documentation examples, and the strict
specification documentation build pass. The container-based Super-Linter
remains unavailable because the local Docker daemon is not running.
Review questions
repository before merge?
measurethe preferred shape for positive whole lodging-unitpenalties such as
night?follow-up required for this stacked Draft?
Category (Required)
Related Issues
Checklist
Validation
Validation for
a30b613:ucp-schema lint source/: 139 files pass; existing W002 warnings only3 local-policy derivations, and 8 complete outcome assertions pass
installing the repository's locked Node development dependencies
Local Super-Linter could not run because the Docker daemon is unavailable. There is
no
sdk/python/generate_models.shin this repository checkout; SDK follow-upis an explicit review question.
The CLA check passes. Existing PR workflow triggers target
mainandrelease/**, so these local validation results are necessary while thisstacked Draft targets
lodging/booking.