From 00f861868fa0e4dee248fc1889b6c1b7c8966ed6 Mon Sep 17 00:00:00 2001 From: callumalpass Date: Fri, 27 Nov 2026 22:16:29 +1100 Subject: [PATCH 1/2] Specify floating local date-times in the collection timezone --- 04-configuration.md | 27 ++-- 06-json-schema-profile.md | 15 +++ 10-cel-profile.md | 39 ++++-- 11-querying.md | 23 ++-- 14-conformance.md | 5 +- CHANGELOG.md | 7 + schemas/v0.3/config.schema.json | 2 +- tests/v0.3/cel/local-date-time.yaml | 187 +++++++++++++++++++++++++++ tests/v0.3/core/local-date-time.yaml | 148 +++++++++++++++++++++ tests/v0.3/manifest.yaml | 2 + 10 files changed, 425 insertions(+), 30 deletions(-) create mode 100644 tests/v0.3/cel/local-date-time.yaml create mode 100644 tests/v0.3/core/local-date-time.yaml diff --git a/04-configuration.md b/04-configuration.md index cdca74f..5b6e811 100644 --- a/04-configuration.md +++ b/04-configuration.md @@ -41,7 +41,7 @@ collection, and a value such as `0.3.0-rc.5` is invalid. | Key | Type | Default | Meaning | | --- | --- | --- | --- | -| `settings.timezone` | string | local runtime | durable IANA timezone for authority-owned calendar semantics | +| `settings.timezone` | string | none | durable IANA timezone for type matching, floating date-times, and other collection-owned calendar semantics | | `settings.types_folder` | string | `_types` | folder containing type files | | `settings.contracts_folder` | string | `_contracts` | folder containing data contract files | | `settings.record_extensions` | list of strings | `[md]` | record file extensions without dot | @@ -67,6 +67,12 @@ calendar authority or model daylight-saving transitions. An invalid configured timezone makes the collection configuration invalid; an implementation MUST NOT silently substitute its runtime timezone. +At a date-time location (Chapter 10), this setting resolves a floating +`local-date-time` to an instant. If the setting is absent, the floating value +stays a string and the record receives a `timezone_required` warning stating +that the collection needs `settings.timezone`. Implementations MUST NOT use +the runtime timezone or an invocation timezone for this resolution. + The types and contracts folders MUST be different normalized paths. Both are reserved control-file folders and are excluded from ordinary record discovery. @@ -93,15 +99,16 @@ single record being written. Checks are divided into three tiers: | cross-record | `collection.unique` rules with `enforce: report`, `link_not_found`, link `target_type` mismatches, `ambiguous_link`, and `path_collision` | reported, never rejected | A single-record check depends only on the record's own path, frontmatter, -body, and the type registry. A cross-record check also depends on other -records; such a check never blocks a write, because another tool, another -device, or a later edit can change the other records at any time. The only -exception is a uniqueness rule that explicitly opts into `enforce: write` -(Chapter 07). +body, the collection configuration, and the type registry. A cross-record +check also depends on other records. It never blocks a write, because another +tool, another device, or a later edit can change the other records at any time. +The only exception is a uniqueness rule that explicitly opts into +`enforce: write` (Chapter 07). -`path_value_inconsistent` and `path_field_in_frontmatter` (Chapter 07) are -single-record checks whose severity is always `warning`: they are reported at -levels `warn` and `error` and never reject a write. +`timezone_required` and the Chapter 07 diagnostics `path_value_inconsistent` +and `path_field_in_frontmatter` always have severity `warning`. Tools report +these single-record diagnostics at levels `warn` and `error`. They never +reject a write. `path_value_normalized` (Chapter 07) is not a validation issue. It is a warning in the result of the write that normalized the value, at every @@ -123,7 +130,7 @@ through an engine. | --- | --- | --- | --- | | `off` | not performed | return records without validation diagnostics | write without record validation | | `warn` | performed | return records with `warning` diagnostics | write and report `warning` diagnostics | -| `error` | performed | return records with `error` diagnostics | fail before writing when the resulting record has a single-record issue; write and report cross-record issues as `warning` diagnostics | +| `error` | performed | report issues as errors except for warning-only checks | reject a single-record error, otherwise write and report warnings | At every level a read returns the record, including an invalid one, and a query evaluates every candidate. Queries do not report per-record validation issues diff --git a/06-json-schema-profile.md b/06-json-schema-profile.md index fd6579f..330bb11 100644 --- a/06-json-schema-profile.md +++ b/06-json-schema-profile.md @@ -139,12 +139,27 @@ profile requires assertion behavior for: - `format: date` - `format: date-time` +- `format: local-date-time` - `format: time` `date`, `time`, and `date-time` use the RFC 3339 productions referenced by JSON Schema. `date-time` values MUST contain `Z` or a numeric UTC offset. Invalid values produce `format_invalid` diagnostics. +A `local-date-time` is a floating clock time. It consists of an RFC 3339 +`full-date`, an uppercase `T`, and `HH:MM`. Seconds (`:SS`) are optional. +When seconds are present they may be followed by a decimal point and one or +more ASCII digits. Clock components use two ASCII digits each, with hours +from 00 to 23 and minutes and seconds from 00 to 59. Examples include +`2026-11-27T08:00`, `2026-11-27T08:00:00`, and `2026-11-27T08:00:00.5`. +Invalid calendar dates, invalid clock times, and values with a `Z` suffix +or numeric offset MUST fail with `format_invalid`. Validation of this +format does not require a timezone. + +A schema using `local-date-time` remains valid JSON Schema 2020-12. Outside +mdbase, unknown formats are annotations under the base dialect. Hosts that +assert mdbase formats must register `local-date-time`. + Other formats such as `email`, `uri`, and `uuid` MAY be asserted by implementations. Collections that require them depend on implementation-specific behavior until a conformance profile defines their semantics. diff --git a/10-cel-profile.md b/10-cel-profile.md index 9bff84d..b20bc42 100644 --- a/10-cel-profile.md +++ b/10-cel-profile.md @@ -247,14 +247,34 @@ strings: - A **timestamp** is CEL's standard `google.protobuf.Timestamp`. - A **duration** is CEL's standard `google.protobuf.Duration`. -Date fields therefore stay strings in every context. In query, projection, and -lifecycle contexts, a string at a location that every matched schema declares -`format: date-time` becomes a timestamp, because date-time offsets make string -comparison unreliable. A schema location is reachable from the root through -`properties`, `items`, and local `$ref`; locations inside `allOf`, `anyOf`, -`oneOf`, `not`, and conditional subschemas are not used for typing. A value -that fails its format stays a string and the record reports `format_invalid`. -Untyped date-times are converted explicitly with `timestamp()`. +Date fields stay strings in every context. In query, projection, and lifecycle +contexts, a location is a **date-time location** when the record matches at +least one schema and every matched schema declares at that location either: + +- `format: date-time` or `format: local-date-time` +- an `anyOf` or `oneOf` whose every branch is a string schema with one of + those two formats + +Locations are reachable from the root through `properties`, `items`, and +local `$ref`. The date-time union above is the sole exception to the rule +that locations inside `anyOf` and `oneOf` are not used for typing. Locations +inside `allOf`, `not`, and conditional subschemas are also excluded. A field +whose branches mix `date` with date-time formats stays a string, even when +the value contains an offset. + +At a date-time location, a valid offset date-time becomes a CEL timestamp. A +valid floating date-time becomes the timestamp of that clock time in the +collection's `settings.timezone`. Omitted seconds are zero. When the clock +time occurs twice during an overlap, use the earlier instant. When the clock +skips that time during a gap, move the clock time forward by the length of +the gap. This matches RFC 5545 and Temporal's `compatible` disambiguation. + +Without `settings.timezone`, the floating value stays a string and the +record gets the warning `timezone_required` (Chapter 04). Implementations +MUST NOT substitute the runtime or invocation timezone. A value that fails +its declared format stays a string and the record reports `format_invalid`. +Floating date-times introduce no new CEL functions. An untyped offset +date-time can be converted explicitly with `timestamp()`. ### Functions @@ -299,7 +319,8 @@ Date results are already strings. A timestamp result serializes as an RFC 3339 date-time in UTC with a `Z` suffix. A duration result serializes as a CEL duration string in seconds, such as `"5400s"`. Typing never changes persisted or `effective_frontmatter` values; it applies only to expression evaluation and -expression results. +expression results. The engine never rewrites a floating value as an instant. +Lifecycle `now: true` continues to write a UTC timestamp with a `Z` suffix. ## Text Helpers diff --git a/11-querying.md b/11-querying.md index 29b28de..2fbe0a7 100644 --- a/11-querying.md +++ b/11-querying.md @@ -190,17 +190,24 @@ the tool. In ascending order, values sort first by kind: | 6 | map | by number of keys | | 7 | null or missing | all equal | -A string is of the date or date-time kind only when the tool knows it is one: +Rank 3 includes: -- the value of a field of a typed record, when every type the record - matches declares the same `format: date` or the same `format: date-time` - for that field, and the value is valid for that format and, for a - date-time, has an offset +- a valid `date` field of a typed record when every matched type declares + `format: date` +- a valid offset date-time at a date-time location as defined in Chapter 10 +- a valid floating date-time at such a location when `settings.timezone` is + configured, ordered by its resolved instant alongside offset date-times - a projection or selection value that is a CEL timestamp -Every other string is of the string kind, however it is written: a string -that merely looks like a date is not guessed to be one, and an invalid value -in a `format: date` field sorts as a string, after every valid date. +Every other string sorts at rank 4. This includes a floating date-time when +the collection has no `settings.timezone`, an invalid date or date-time, an +untyped string that looks like a date, and a field whose schema mixes +`date` and date-time branches. + +Changing `settings.timezone` can change the resolved instant of a floating +value and its position in a query. Implementations MUST include the +collection timezone (including its absence) in the catalog fingerprint for +materialized index rows and invalidate cached query state that depends on it. Two lists with the same number of items, and two maps with the same number of keys, compare equal whatever they contain. A query that needs an order diff --git a/14-conformance.md b/14-conformance.md index f36fda2..8f8eecb 100644 --- a/14-conformance.md +++ b/14-conformance.md @@ -177,7 +177,7 @@ The v0.3 core codes include `invalid_request`, `duplicate_batch_path`, `invalid_data_contract`, `data_contract_not_found`, `data_contract_conflict`, `data_contract_version_mismatch`, `data_contract_binding_invalid`, `data_contract_field_invalid`, `data_contract_record_invalid`, -`invalid_timezone`, and the JSON Schema `schema_` codes from Chapter +`timezone_required`, `invalid_timezone`, and the JSON Schema `schema_` codes from Chapter 06. Runtime profile 0.2 reuses interoperability codes such as `unknown_contract`, `contract_digest_conflict`, `no_provider`, `ambiguous_provider`, and `capability_denied`, and additionally defines @@ -247,7 +247,8 @@ CEL implementations MUST: - support the CEL optional types extension - supply the system bindings defined for that context in Chapter 10 - preserve the mdbase missing, null, raw, and effective-value contract -- type `format: date-time` values as timestamps and provide `now()`, +- type offset and floating values at date-time locations according to Chapter + 10 and provide `now()`, `today()`, the date conversions, and the date-string methods with declared timezone behavior - provide the `lower()` and `upper()` text helpers with Unicode default case diff --git a/CHANGELOG.md b/CHANGELOG.md index ca6ffea..1d7d1eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this specification and conformance suite are documented here. +## Unreleased + +- The profile asserts `local-date-time` for floating clock times. At + date-time locations, CEL and query ordering resolve them in the collection + timezone. When the setting is absent they remain strings and validation + reports a `timezone_required` warning. + ## Runtime standard pack 0.2.1 and `@callumalpass/mdbase-runtime` 0.2.1 (2026-11-17) The specification itself is unchanged. diff --git a/schemas/v0.3/config.schema.json b/schemas/v0.3/config.schema.json index 838cfef..2d04f1b 100644 --- a/schemas/v0.3/config.schema.json +++ b/schemas/v0.3/config.schema.json @@ -23,7 +23,7 @@ "timezone": { "type": "string", "minLength": 1, - "description": "Durable IANA timezone for collection-authority calendar semantics" + "description": "Durable IANA timezone for type matching, resolving floating date-times, and other collection-owned calendar semantics" }, "types_folder": { "type": "string", diff --git a/tests/v0.3/cel/local-date-time.yaml b/tests/v0.3/cel/local-date-time.yaml new file mode 100644 index 0000000..09d863b --- /dev/null +++ b/tests/v0.3/cel/local-date-time.yaml @@ -0,0 +1,187 @@ +name: "Floating date-time typing and ordering" +spec_version: "0.3.0" +fixture_set: cel +category: query +spec_ref: "v0.3/10, v0.3/11" + +groups: + - name: "America/New_York clock times" + setup: + config: | + spec_version: "0.3.0" + settings: { timezone: America/New_York } + types: + event.md: | + --- + kind: mdbase.type + name: event + version: 1 + match: { path_glob: "events/**/*.md" } + schema: + dialect: json-schema-2020-12 + value: + type: object + properties: + clock: { type: string, format: local-date-time } + at: + anyOf: + - { type: string, format: date-time } + - { type: string, format: local-date-time } + start: + oneOf: + - { type: string, format: date-time } + - { type: string, format: local-date-time } + due: + anyOf: + - { type: string, format: date } + - { type: string, format: date-time } + - { type: string, format: local-date-time } + --- + appointment.md: | + --- + kind: mdbase.type + name: appointment + version: 1 + match: { path_glob: "events/gap.md" } + schema: + dialect: json-schema-2020-12 + value: + type: object + properties: + clock: + anyOf: + - { type: string, format: local-date-time } + - { type: string, format: date-time } + start: { type: string } + --- + files: + events/overlap.md: | + --- + clock: "2026-11-01T01:30" + at: "2026-11-01T01:30" + start: "2026-11-01T01:30" + due: "2026-11-01T01:30" + --- + events/gap.md: | + --- + clock: "2026-03-08T02:30:12.5" + start: "2026-03-08T02:30:12.5" + --- + events/early.md: | + --- + at: "2026-11-01T04:15:00Z" + due: "2026-11-01T04:15:00Z" + --- + events/late.md: | + --- + at: "2026-11-01T01:00:00-05:00" + start: "2026-11-01T01:00:00-05:00" + due: "2026-11-01T01:00:00-05:00" + --- + events/after.md: | + --- + at: "2026-11-01T03:00" + due: "2026-11-01T03:00" + --- + tests: + - name: "direct, anyOf, and oneOf locations use the earlier overlap instant" + id: cel.local_date_time_overlap + covers: [cel.date_and_duration, cel_query.query_filtering] + operation: query + input: + timezone: UTC + where: >- + clock == timestamp("2026-11-01T05:30:00Z") && + at == clock && start == clock && due == "2026-11-01T01:30" + expect: + valid: true + results: [{ path: events/overlap.md }] + + - name: "a gap advances the clock by the gap length, preserving minutes and fraction" + id: cel.local_date_time_gap + covers: [cel.date_and_duration] + operation: evaluate_cel + input: + path: events/gap.md + expression: 'clock == timestamp("2026-03-08T07:30:12.5Z")' + expect: { valid: true, value: true } + + - name: "typing requires a date-time declaration in every matched schema" + id: cel.local_date_time_all_matched_types + covers: [cel.date_and_duration] + operation: evaluate_cel + input: + path: events/gap.md + expression: 'clock == timestamp("2026-03-08T07:30:12.5Z") && start == "2026-03-08T02:30:12.5"' + expect: { valid: true, value: true } + + - name: "an offset remains an instant at both date-time unions" + id: cel.date_time_union_offset + covers: [cel.date_and_duration] + operation: evaluate_cel + input: + path: events/late.md + expression: 'start == timestamp("2026-11-01T06:00:00Z") && at == start && due == "2026-11-01T01:00:00-05:00"' + expect: { valid: true, value: true } + + - name: "an invocation timezone cannot resolve floating values without a collection timezone" + id: cel.local_date_time_without_zone + covers: [cel.date_and_duration, cel_query.query_filtering] + operation: query + setup: + config: | + spec_version: "0.3.0" + input: + timezone: America/New_York + where: 'clock == "2026-11-01T01:30" && at == clock && start == clock' + expect: + valid: true + results: [{ path: events/overlap.md }] + + - name: "resolved floating values interleave with offset values by instant" + id: query.local_date_time_order_instants + covers: [cel_query.value_order] + operation: query + input: + where: 'has(record.at)' + order_by: [{ field: at }] + expect: + valid: true + results: + - { path: events/early.md } + - { path: events/overlap.md } + - { path: events/late.md } + - { path: events/after.md } + + - name: "without a collection timezone floating strings follow all offset instants" + id: query.local_date_time_order_without_zone + covers: [cel_query.value_order] + operation: query + setup: + config: | + spec_version: "0.3.0" + input: + where: 'has(record.at)' + order_by: [{ field: at }] + expect: + valid: true + results: + - { path: events/early.md } + - { path: events/late.md } + - { path: events/overlap.md } + - { path: events/after.md } + + - name: "a union with a date branch orders both floating and offset values as strings" + id: query.local_date_time_order_mixed_date + covers: [cel_query.value_order] + operation: query + input: + where: 'has(record.due)' + order_by: [{ field: due }] + expect: + valid: true + results: + - { path: events/late.md } + - { path: events/overlap.md } + - { path: events/after.md } + - { path: events/early.md } diff --git a/tests/v0.3/core/local-date-time.yaml b/tests/v0.3/core/local-date-time.yaml new file mode 100644 index 0000000..3cd3bec --- /dev/null +++ b/tests/v0.3/core/local-date-time.yaml @@ -0,0 +1,148 @@ +name: "Floating date-time validation" +spec_version: "0.3.0" +fixture_set: core_collection +category: validation +spec_ref: "v0.3/04, v0.3/06" + +groups: + - name: "local-date-time syntax" + setup: + config: | + spec_version: "0.3.0" + settings: { timezone: UTC } + types: + clocks.md: | + --- + kind: mdbase.type + name: clocks + version: 1 + match: { path_glob: "clocks/**/*.md" } + schema: + dialect: json-schema-2020-12 + value: + type: object + additionalProperties: { type: string, format: local-date-time } + --- + files: + clocks/valid.md: | + --- + minutes: "2026-11-27T08:00" + seconds: "2026-11-27T08:00:00" + fraction: "2026-11-27T08:00:00.5" + precision: "2026-11-27T08:00:00.0123456789" + leap_day: "2024-02-29T12:00" + --- + clocks/invalid.md: | + --- + hour: "2026-11-27T24:00" + minute: "2026-11-27T08:60" + day: "2026-02-30T08:00" + utc: "2026-11-27T08:00:00Z" + offset: "2026-11-27T08:00:00+10:00" + date_only: "2026-11-27" + space: "2026-11-27 08:00" + minute_fraction: "2026-11-27T08:00.5" + empty_fraction: "2026-11-27T08:00:00." + unicode_fraction: "2026-11-27T08:00:00.٥" + --- + tests: + - name: "accept valid dates and optional seconds and fractions" + id: core.local_date_time_valid + covers: [core_read.json_schema_formats] + operation: validate + input: { path: clocks/valid.md } + expect: { valid: true, issues: [] } + + - name: "report each invalid local-date-time at its field" + id: core.local_date_time_invalid + covers: [core_read.json_schema_formats] + operation: validate + input: { path: clocks/invalid.md } + expect: + valid: false + issues: + - { code: format_invalid, field: hour } + - { code: format_invalid, field: minute } + - { code: format_invalid, field: day } + - { code: format_invalid, field: utc } + - { code: format_invalid, field: offset } + - { code: format_invalid, field: date_only } + - { code: format_invalid, field: space } + - { code: format_invalid, field: minute_fraction } + - { code: format_invalid, field: empty_fraction } + - { code: format_invalid, field: unicode_fraction } + + - name: "a missing collection timezone is a record warning" + setup: + config: | + spec_version: "0.3.0" + settings: { validation: error } + types: + event.md: | + --- + kind: mdbase.type + name: event + version: 1 + match: { path_glob: "events/**/*.md" } + schema: + dialect: json-schema-2020-12 + value: + type: object + properties: + at: { type: string, format: local-date-time } + --- + files: + events/existing.md: | + --- + at: "2026-11-27T08:00" + --- + tests: + - name: "a floating value needs a collection timezone at validation error" + id: core.timezone_required_error + covers: [core_read.machine_readable_diagnostics] + operation: validate + input: { path: events/existing.md } + expect: + valid: true + issues: [{ code: timezone_required, severity: warning, field: at }] + + - name: "a floating value needs a collection timezone at validation warn" + id: core.timezone_required_warn + covers: [core_read.machine_readable_diagnostics] + operation: validate + setup: + config: | + spec_version: "0.3.0" + settings: { validation: warn } + input: { path: events/existing.md } + expect: + valid: true + issues: [{ code: timezone_required, severity: warning, field: at }] + + - name: "the warning permits writing the floating value at validation error" + id: core.timezone_required_write + covers: [core_write.validation_tiers] + operation: create + input: + path: events/new.md + type: event + frontmatter: { at: "2026-11-27T08:00" } + expect: + valid: true + frontmatter: { at: "2026-11-27T08:00" } + diagnostics: [{ code: timezone_required, severity: warning, field: at }] + + - name: "a configured timezone leaves persisted and effective frontmatter floating" + id: core.local_date_time_frontmatter + covers: [core_read.json_schema_formats] + operation: read + setup: + config: | + spec_version: "0.3.0" + settings: { timezone: Australia/Melbourne } + input: { path: events/existing.md } + expect: + valid: true + frontmatter: { at: "2026-11-27T08:00" } + effective_frontmatter: { at: "2026-11-27T08:00" } + diagnostics: [] diff --git a/tests/v0.3/manifest.yaml b/tests/v0.3/manifest.yaml index 34813b7..b245630 100644 --- a/tests/v0.3/manifest.yaml +++ b/tests/v0.3/manifest.yaml @@ -234,6 +234,7 @@ fixture_sets: coverage_targets: [core_read, collection_semantics, links, core_write, lifecycle] files: - core/core-collection.yaml + - core/local-date-time.yaml - core/optional-membership.yaml - core/core-write.yaml - core/links-and-discovery.yaml @@ -268,6 +269,7 @@ fixture_sets: - cel/match-determinism.yaml - cel/regex-profile.yaml - cel/query-order.yaml + - cel/local-date-time.yaml - id: views description: Ordinary view records resolve named queries, invocation context, and advisory presentation. coverage_targets: [cel_query] From 2539ef3c44edb1ed63ff0f2255f7877a45a388f2 Mon Sep 17 00:00:00 2001 From: callumalpass Date: Fri, 27 Nov 2026 22:29:16 +1100 Subject: [PATCH 2/2] Clarify format validity prerequisite for date-time typing and timezone_required --- 10-cel-profile.md | 16 ++++++++++------ tests/v0.3/core/local-date-time.yaml | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/10-cel-profile.md b/10-cel-profile.md index b20bc42..36ed8bc 100644 --- a/10-cel-profile.md +++ b/10-cel-profile.md @@ -262,17 +262,21 @@ inside `allOf`, `not`, and conditional subschemas are also excluded. A field whose branches mix `date` with date-time formats stays a string, even when the value contains an offset. -At a date-time location, a valid offset date-time becomes a CEL timestamp. A -valid floating date-time becomes the timestamp of that clock time in the +At a date-time location, a string that satisfies every matched schema's +declared format becomes a CEL timestamp: an offset date-time resolves +directly, and a floating date-time resolves to that clock time in the collection's `settings.timezone`. Omitted seconds are zero. When the clock time occurs twice during an overlap, use the earlier instant. When the clock skips that time during a gap, move the clock time forward by the length of the gap. This matches RFC 5545 and Temporal's `compatible` disambiguation. -Without `settings.timezone`, the floating value stays a string and the -record gets the warning `timezone_required` (Chapter 04). Implementations -MUST NOT substitute the runtime or invocation timezone. A value that fails -its declared format stays a string and the record reports `format_invalid`. +Without `settings.timezone`, a floating value that satisfies the location's +declared format stays a string and the record gets the warning +`timezone_required` (Chapter 04). Implementations MUST NOT substitute the +runtime or invocation timezone. A value that fails a matched schema's +declared format — such as a floating value in a `format: date-time`-only +field, or an offset value in a `format: local-date-time`-only field — stays a +string and reports `format_invalid` alone (without `timezone_required`). Floating date-times introduce no new CEL functions. An untyped offset date-time can be converted explicitly with `timestamp()`. diff --git a/tests/v0.3/core/local-date-time.yaml b/tests/v0.3/core/local-date-time.yaml index 3cd3bec..93c590b 100644 --- a/tests/v0.3/core/local-date-time.yaml +++ b/tests/v0.3/core/local-date-time.yaml @@ -90,12 +90,17 @@ groups: type: object properties: at: { type: string, format: local-date-time } + instant_only: { type: string, format: date-time } --- files: events/existing.md: | --- at: "2026-11-27T08:00" --- + events/wrong-format.md: | + --- + instant_only: "2026-11-27T08:00" + --- tests: - name: "a floating value needs a collection timezone at validation error" id: core.timezone_required_error @@ -106,6 +111,15 @@ groups: valid: true issues: [{ code: timezone_required, severity: warning, field: at }] + - name: "a floating value in a date-time-only field reports only format_invalid without a zone" + id: core.date_time_only_rejects_floating_without_timezone_warning + covers: [core_read.json_schema_formats, core_read.machine_readable_diagnostics] + operation: validate + input: { path: events/wrong-format.md } + expect: + valid: false + issues: [{ code: format_invalid, severity: error, field: instant_only }] + - name: "a floating value needs a collection timezone at validation warn" id: core.timezone_required_warn covers: [core_read.machine_readable_diagnostics]