]> dreyeck.freedombox.rocks Git - topic-maps.git/blob - docs/slice-8-validation.md
Support XTM topic map reification (Slice 21L)
[topic-maps.git] / docs / slice-8-validation.md
1 # Slice 8 — Decimal Occurrences: validation evidence
2
3 Repository `/Users/rgb/workspace/topic-maps`. Verified initial branch
4 `codex/ctm-slice-7`, HEAD `17dd58775e25ab495e3c83deb4b5a36f5e5a124b`, clean
5 working tree and index. Created `codex/ctm-slice-8` from that commit.
6 Corpus pin remains `cd165b150176c1d6842b37be9cc9051b40d4996b`. Original inputs,
7 baselines and reference files are unchanged.
8
9 ## Normative contract
10
11 The rules were recorded before implementation in
12 [Reading Decimal Occurrences](reading-decimal-occurrences.md):
13 CTM §3.4.1 (productions 28–34), TMDM §§4.3–4.4, 5.6, 6.5,
14 CXTM §§3.8, 3.14, 3.16, 4.2–4.3, 4.9, and XML Schema Part 2
15 §§3.2.3–3.2.3.2, 4.3.6. Sources are linked there.
16
17 The existing TMDM model remains the only model. Decimal values are strings;
18 the exact Datatype Locator is `http://www.w3.org/2001/XMLSchema#decimal`.
19 The reader's existing bare-number policy uses canonical value strings;
20 this is explicitly a local representation policy, not a new normative mandate.
21 Qualified strings and direct model insertions retain their valid lexical strings.
22 TMDM equality stays lexical and datatype-sensitive. CXTM canonicalizes the
23 output without rewriting or merging the input, and sorts the stored strings
24 rather than numeric values or formatted XML. All new core operations use
25 character sequences; no binary floating point or precision-dependent arithmetic
26 is used. Unknown datatype treatment stays unchanged.
27
28 ## Seven original end-to-end results
29
30 Each original creates one Topic Map, two Topics and one Occurrence, with the
31 stored Parent EQ `topic` and Type EQ `occtype`; datatype is a locator, not a Topic.
32 Local Item Identifiers are absolute DocumentIRI fragments. SI/SL, Names,
33 Associations and Occurrence Item Identifiers are empty. The existing absolute
34 Document-IRI/Base-Locator policy is retained. CXTM numbers Type=1, Parent=2,
35 Occurrence=1. All comparisons below use original UTF-8 bytes directly.
36
37 | File under `ctm/in/` | Stored string | CXTM bytes | Result |
38 | --- | --- | ---: | --- |
39 | occurrence-decimal.ctm | `"9.3"` | 353 | PASS |
40 | occurrence-decimal-dot.ctm | `"0.3"` | 353 | PASS |
41 | occurrence-decimal-dot-neg.ctm | `"-0.3"` | 354 | PASS |
42 | occurrence-decimal-leading-zeros.ctm | `"0.3"` | 353 | PASS |
43 | occurrence-decimal-minus-sign.ctm | `"-9.3"` | 354 | PASS |
44 | occurrence-decimal-plus-sign.ctm | `"9.3"` | 353 | PASS |
45 | occurrence-decimal-1.0.ctm | `"1.0"` | 353 | PASS |
46
47 The 39 preceding positive sources, model observations and actual canonical
48 outputs are unchanged. All three specific negative prefix results remain PASS.
49 Only the seven selected positive imported contracts change NOT-RUN → PASS.
50
51 | Imported contracts | PASS | FAIL | UNSUPPORTED | NOT-RUN |
52 | --- | ---: | ---: | ---: | ---: |
53 | All 273 | 49 | 0 | 0 | 224 |
54 | Positive CXTM contracts | 46 | 0 | 0 | 185 |
55 | Negative CTM contracts | 3 | 0 | 0 | 39 |
56
57 Unselected inputs are not counted as passing just because their syntax may
58 now happen to be accepted. Semantic assertions and actual byte comparisons
59 remain separate evidence.
60
61 ## Full fresh offline regressions
62
63 Both runs disable system/user initialization and inherited ASDF configuration.
64 OS `sandbox-exec` denies network access. SBCL 2.4.10 runs from a separately
65 copied checkout under `/private/tmp`; its document IRIs do not depend on location.
66
67 | Suite | SBCL 2.5.4 | SBCL 2.4.10, relocated |
68 | --- | ---: | ---: |
69 | Foundation | 54 | 54 |
70 | Topic Identity | 123 | 123 |
71 | Topic Merging | 646 | 646 |
72 | Associations / Roles | 657 | 657 |
73 | Retained CXTM | 445 | 445 |
74 | Occurrences | 1,101 | 1,101 |
75 | Prefix / explicit datatypes | 150 | 150 |
76 | Integers | 665 | 665 |
77 | Decimals | 715 | 715 |
78 | **Total Lisp checks** | **4,556** | **4,556** |
79 | Python infrastructure tests | 2 | 2 |
80 | Independent Unicode NFC oracle | 16,294 | 16,294 |
81 | Independent Integer arithmetic oracle | 143 | 143 |
82 | Independent Decimal arithmetic oracle | 157 | 157 |
83 | Original positive CXTM byte comparisons | 46 | 46 |
84 | Failures | **0** | **0** |
85
86 All **nine report pairs are byte-identical** across runtime versions and checkout
87 relocation. The combined CXTM report's 3,076 checks comprise retained CXTM,
88 Occurrence, prefix, Integer and Decimal checks; they are not an additional suite.
89 The exact public Lisp inspection example was executed successfully offline.
90
91 The 715 Decimal checks cover sign/zero rules, integer/fractional components,
92 long values (10,000-digit components and tiny fractions), CTM boundaries
93 `1.0.`, `.3.`, `9.3.` and retained `1.`, XML-whitespace handling, errors and
94 source positions, datatype-only distinctions, lexical duplicate removal,
95 Parent/Type merging, identifier union, canonical reference slots, retained
96 Occurrence handles, all representative construction permutations and purity.
97 Python's independent Decimal arithmetic normalizes with explicitly sufficient
98 precision, never binary floats or an implicitly rounded context.
99
100 Old exclusions were adapted one-for-one: two formerly unsupported Decimal
101 syntax fixtures now exercise Date and `*`; the private unsupported-datatype
102 fixture now uses Date; explicit Decimal canonicalization is now expected to
103 succeed, and four formerly unsupported Decimal literals now assert their datatype.
104 Existing suite totals and original-case observations remain unchanged. No tests
105 are deleted, and no upstream input/baseline is changed. Initial development
106 compilation corrections precede these final successful runs.
107
108 ## Reproduction and retained evidence
109
110 ```sh
111 python3 /Users/rgb/workspace/topic-maps/scripts/validate-slice-8.py \
112 --sbcl-254 /nix/store/hlsiblxpxr1hax3dw9x8znd6zy097ddj-sbcl-2.5.4/bin/sbcl \
113 --sbcl-2410 /nix/store/y96nx8571mpdvjd40krkdim2av0in972-sbcl-2.4.10/bin/sbcl \
114 --output /private/tmp/topic-maps-slice-8-reproduction
115 ```
116
117 The actual validation used `--output reports/slice-8`. The script runs both
118 fresh offline suites, relocates the second checkout, compares all reports,
119 checks retained Slice-7 cases/outputs, checks original baseline bytes, executes
120 the documented example and records exact commands, versions, exit codes and
121 artifact hashes in `reports/slice-8/execution.json`. It provisions no software,
122 changes no source corpus, starts no server and makes no commit. It requires
123 already installed runtimes, macOS `sandbox-exec`, and Python UCD 15.0/15.1.
124
125 A single full fresh run:
126
127 ```sh
128 /usr/bin/sandbox-exec -p '(version 1)(allow default)(deny network*)' \
129 /usr/bin/env PYTHONDONTWRITEBYTECODE=1 \
130 SBCL=/nix/store/hlsiblxpxr1hax3dw9x8znd6zy097ddj-sbcl-2.5.4/bin/sbcl \
131 TOPIC_MAPS_REPORT=/private/tmp/topic-maps-slice-8.json \
132 /Users/rgb/workspace/topic-maps/scripts/test.sh
133 ```
134
135 `reports/slice-8/` retains raw logs, nine reports, all 46 actual CXTM byte files,
136 DESCRIBE output and the execution manifest. `decimals.json` includes unmodified
137 sources, absolute Document IRIs, actual model properties/reference ordinals and
138 157 probes. Full remaining limits and copy-pasteable inspection are in the
139 reading document. No selected normative/corpus conflict was found.
140
141 Date, DateTime, CTM `*` semantics, nonempty Scope, Reification, Variants,
142 Templates, cross-document merging and HyperDoc integration remain outside scope.
143 Only the exact xsd:decimal datatype receives these rules. No Slice 9 is begun.