]> dreyeck.freedombox.rocks Git - topic-maps.git/blob - docs/slice-11-validation.md
Qualify pinned CXML encodings with reproducible local patches
[topic-maps.git] / docs / slice-11-validation.md
1 # Slice 11 — DateTime Timezone Canonicalization: validation
2
3 Base `8741d155d948c7317945eee423a977940cad995e`, verified clean on
4 `codex/ctm-slice-10`; branch `codex/ctm-slice-11` created directly from it.
5 No HyperDoc change, push, server, deployment or Slice 12 work.
6
7 ## Normative decisions and implementation
8
9 See [Reading DateTime Timezone Canonicalization](reading-datetime-timezones.md)
10 for the preimplementation normative decisions and executed inspection example.
11 CXTM 3.16, XSD Second Edition 3.2.7.1–3.2.7.4, TMDM 4.3–4.4/5.6/6.5 apply;
12 CXTM 4.3/4.9 ordering remains comparison of stored property strings.
13 No XSD instant-order API or different TMDM equality is introduced.
14
15 `canonical-datetime-lexical-form` reuses `datetime-parts`/Date validation;
16 `datetime-offset-minutes` parses only an already validated short offset.
17 `previous-datetime-date` reuses the Date validator for month length, and
18 `previous-datetime-year` inverts the existing character-based next-year helper.
19 Only hour/minute arithmetic uses small integers. Years and fractional digits
20 remain character sequences. The public canonical helper returns a derived
21 string and status; reader/CXTM retain specific invalid/unsupported conditions.
22
23 All offsets from -14:00 through +14:00 are tested minute by minute. Z, +00:00,
24 -00:00 and absence are tested separately. Calendar probes cover leap centuries,
25 28/29/30/31-day months, 24:00:00, year changes, 10000-digit years and fractions.
26 Nonzero-offset BCE day rollover and second-60 contexts remain explicitly
27 unsupported; inherited zero/absent-zone leap handling is unchanged.
28
29 Qualified strings/API values retain spelling. Bare CTM literals retain the
30 accepted canonical stored-string policy. Type/Parent stay Topic references;
31 the datatype is the locator `http://www.w3.org/2001/XMLSchema#dateTime`.
32 Pure CXTM generation changes neither live objects nor retained merge handles.
33 Distinct stored strings can produce equal CXTM without becoming equal TMDM
34 Occurrences. Actual duplicate merging still uses the stored properties.
35
36 ## Original timezone2 evidence
37
38 The original source is unchanged:
39
40 ```ctm
41 datetime - "datetime" .
42
43 some-topic - "some topic" ;
44 datetime: 2011-01-01T00:00:00+02:00
45 .
46 ```
47
48 Document IRI / Base Locator:
49 `https://ctm-tests.example.invalid/cd165b150176c1d6842b37be9cc9051b40d4996b/ctm/in/occurrence-datetime-timezone2.ctm`.
50
51 Actual model: three Topics (local datetime, local some-topic, standard name-type
52 Topic), two Names, one Occurrence, no Associations. The Occurrence's Parent is
53 the some-topic object and Type is the datetime object. Stored bare Value:
54 `2010-12-31T22:00:00Z`; Datatype: xsd:dateTime locator; Item Identifiers: empty.
55
56 Actual CXTM contains `<value>2010-12-31T22:00:00Z</value>` (674 UTF-8 bytes).
57 Unmodified expected CXTM contains `<value>2011-01-01T00:00:00+02:00</value>`
58 (679 bytes). First differing zero-based byte: 382. Imported result: **FAIL**.
59 The independent UTC/model assertions pass. The comparison is genuinely run;
60 there is no filename-specific implementation or changed baseline.
61
62 The original datetime2 result remains 370 actual/expected bytes, differing at
63 byte 232: actual `1976-09-19T12:02:00`, baseline `1976-09-19T12:01:60`.
64 The Slice 10 D.1 interpretation and normative qualification are retained.
65
66 ## Full execution results
67
68 Both runtimes ran fresh, with `--no-sysinit --no-userinit`, no inherited ASDF
69 registry and macOS sandbox network denial. The 2.4.10 run used a relocated
70 checkout without .git. Every group below passed in both runs.
71
72 | Group | Checks per runtime |
73 |---|---:|
74 | Foundation | 54 |
75 | Topic identity | 123 |
76 | Topic merging | 646 |
77 | Associations and Roles | 657 |
78 | Retained CXTM assertions | 445 |
79 | Occurrences | 1101 |
80 | Prefix/datatype | 150 |
81 | Integer | 665 |
82 | Decimal | 715 |
83 | Date | 1806 |
84 | DateTime | 217 |
85 | DateTime timezones | 1944 |
86 | **Total Lisp assertions** | **8523** |
87
88 Additionally per run: two Python integrity tests, 16294 Unicode NFC oracle
89 comparisons; 143 Integer, 157 Decimal, 396 Date, 45 DateTime and 1774 timezone
90 oracle probes. The timezone oracle uses arbitrary Python integers/calendar
91 arithmetic and an additional fixed-UTC datetime cross-check in its CE range;
92 no implicit local timezone or floating-point fractions.
93
94 All twelve JSON report pairs are byte-identical. All 55 previous canonical
95 outputs and all four previous DateTime object observations remain unchanged;
96 all previous 54 positive matches and eight negative passes remain PASS.
97 Original corpus and reference bytes are unchanged. The documented Lisp example
98 was executed successfully offline; its output is in `describe.log`.
99
100 Imported statuses: **62 PASS, 2 FAIL, 0 UNSUPPORTED, 209 NOT-RUN** (273 total).
101 Of 56 executed positive CXTM contracts, 54 match byte-for-byte and two have the
102 documented normative discrepancy. The only imported status transition from
103 Slice 10 is timezone2: NOT-RUN → FAIL. Unsupported helper probes are independent
104 semantic tests and do not change unexecuted imported statuses.
105
106 Existing assertions expecting ordinary offsets to be unsupported were adapted
107 to supported-offset tests and remaining leap-context rejection fixtures.
108 Initial development runs caught two missing form delimiters and those obsolete
109 unsupported expectations; the final complete runs have no assertion failures.
110
111 ## Reproduction and evidence
112
113 ```sh
114 python3 scripts/validate-slice-11.py \
115 --sbcl-254 /nix/store/hlsiblxpxr1hax3dw9x8znd6zy097ddj-sbcl-2.5.4/bin/sbcl \
116 --sbcl-2410 /nix/store/y96nx8571mpdvjd40krkdim2av0in972-sbcl-2.4.10/bin/sbcl \
117 --output /private/tmp/topic-maps-slice-11-reproduction
118 ```
119
120 Committed evidence: `reports/slice-11/execution.json` records commands, exit
121 codes, runtime versions, counts and artifact hashes; the directory also contains
122 both logs, twelve deterministic reports, actual XML for all 56 comparisons and
123 the inspection output. The validator's PASS means successful implementation
124 assertions with two explicitly retained imported FAILs, not full ISO conformity.
125
126 Remaining exclusions: Date timezone canonicalization, nonzero-offset BCE day
127 rollover and leap-second canonicalization, CTM *, Variants, nonempty Scope,
128 Reification, Templates, cross-document merging and HyperDoc integration.