]> dreyeck.freedombox.rocks Git - topic-maps.git/blob - docs/slice-4-validation.md
docs: design draft for a read-only SHOP3 adapter over TMDM objects
[topic-maps.git] / docs / slice-4-validation.md
1 # Slice 4 โ€” Validation and acceptance evidence
2
3 Base: `35648c4dcc71e8dc6448b64abcacb438e53d64a2`.
4 Branch: `codex/ctm-slice-4`. The initial Slice 3 branch/HEAD were verified and the
5 working tree was clean before creating the branch.
6
7 The core addition is `topic-maps/cxtm`, depending only on `topic-maps/tmdm`.
8 No CTM reader/model source, original corpus file, baseline or lock changed.
9 No server, deployment or HyperDoc integration was performed.
10
11 ## Executed evidence
12
13 Both complete launches used fresh SBCL processes, ignored system/user init,
14 and denied network access with `sandbox-exec`. One used SBCL 2.5.4 at the original
15 checkout; the other used SBCL 2.4.10 in an independent relocated copy. The NFC
16 oracle launches an additional fresh SBCL process and verifies that neither the
17 CTM nor foundation package is loaded when only the canonicalizer is requested.
18 Python UCD version in both recorded runs: 15.1.0.
19
20 | Executable checks, per runtime | PASS | FAIL |
21 | --- | ---: | ---: |
22 | Retained infrastructure | 54 | 0 |
23 | Retained identity semantics | 123 | 0 |
24 | Retained Topic/Name merge semantics | 646 | 0 |
25 | Retained Association/Role semantics | 657 | 0 |
26 | New CXTM checks | 445 | 0 |
27 | Independent Python NFC oracle comparisons | 16,294 | 0 |
28 | Python corpus-integrity fixtures | 2 | 0 |
29
30 The 445 checks include 24 literal byte comparisons/purity observations, 48
31 construction permutations, 128 graph/edge-order variants, current/retained
32 reference checks after Topic/Name/Association/Role replacement, canonical set
33 ordering/numbering, file output, NFC/UTF-8/escaping and explicit error contracts.
34 The 16,294 oracle comparisons cover 4,122 canonical mapping/decomposition inputs,
35 all 11,172 Hangul decompositions and 1,000 seeded combining sequences. This is
36 an independent algorithm comparison, not a claim that every Unicode string
37 or the complete UAX conformance suite was exercised.
38
39 All five report pairs are byte-identical across runtimes and relocation:
40 validation, semantics, merging, associations and CXTM. The 24 original semantic
41 case observation records equal the committed Slice 3 records. The copied
42 DESCRIBE/serialization example from the reading document was independently
43 executed, including assertions for the two Topics, one Name and 328 bytes.
44
45 ## Imported contracts
46
47 | Corpus scope | PASS | FAIL | UNSUPPORTED | NOT-RUN |
48 | --- | ---: | ---: | ---: | ---: |
49 | 24 selected positive `:CXTM-EQUAL` contracts | 24 | 0 | 0 | 0 |
50 | All 273 imported CTM contracts | 25 | 0 | 0 | 248 |
51
52 The additional PASS remains the specific `undefined-prefix` rejection of
53 `ctm/invalid/prefix-undefined.ctm`. The remaining 207 positive and 41 negative
54 contracts were not executed. They have no inferred acceptance/conformity status.
55
56 | Original input | CXTM result | UTF-8 bytes, actual = expected |
57 | --- | --- | ---: |
58 | `ctm/in/simple.ctm` | PASS | 114 |
59 | `ctm/in/subject-identifier.ctm` | PASS | 141 |
60 | `ctm/in/subject-locator.ctm` | PASS | 139 |
61 | `ctm/in/item-identifier.ctm` | PASS | 137 |
62 | `ctm/in/name.ctm` | PASS | 328 |
63 | `ctm/in/topic-subject-identifier.ctm` | PASS | 207 |
64 | `ctm/in/topic-subject-identifier-wrapped.ctm` | PASS | 207 |
65 | `ctm/in/topic-subject-identifier-duplicate.ctm` | PASS | 146 |
66 | `ctm/in/topic-subject-locator.ctm` | PASS | 201 |
67 | `ctm/in/topic-subject-locator-wrapped.ctm` | PASS | 201 |
68 | `ctm/in/topic-subject-locator-semi.ctm` | PASS | 201 |
69 | `ctm/in/topic-subject-locator-duplicate.ctm` | PASS | 112 |
70 | `ctm/in/topic-item-identifier.ctm` | PASS | 159 |
71 | `ctm/in/topic-item-identifier-wrapped.ctm` | PASS | 159 |
72 | `ctm/in/topic-item-identifier-duplicate.ctm` | PASS | 114 |
73 | `ctm/in/name-duplicate.ctm` | PASS | 328 |
74 | `ctm/in/association.ctm` | PASS | 507 |
75 | `ctm/in/association-binary.ctm` | PASS | 833 |
76 | `ctm/in/association-binary-duplicate.ctm` | PASS | 833 |
77 | `ctm/in/association-type-sid.ctm` | PASS | 535 |
78 | `ctm/in/association-with-comment.ctm` | PASS | 507 |
79 | `ctm/in/association-with-comment2.ctm` | PASS | 507 |
80 | `ctm/in/association-with-comment3.ctm` | PASS | 507 |
81 | `ctm/in/association-with-comment4.ctm` | PASS | 507 |
82
83 Every case was deserialized from its original source with the recorded absolute
84 Document IRI, canonicalized with that IRI as explicit base, then compared against
85 the original binary baseline. Mismatches report the first differing byte and
86 both lengths. Unsupported CTM/CXTM conditions map to UNSUPPORTED; unrelated
87 failures map to FAIL. No XML whitespace trimming, locator rewriting of baselines
88 or incomplete serialization comparison is used to award PASS.
89
90 `reports/slice-4/cxtm.json` contains the complete actual and expected XML for all
91 24 cases, logical bases and byte counts. `reports/slice-4/actual/` preserves the
92 actual generated UTF-8 files, independently checked against the unchanged
93 baselines. `execution.json` records exact launches, checkout locations, exits,
94 Python version, result counts and artifact SHA-256 values. Logs retain raw output.
95
96 ## Normative interpretation and limits
97
98 The exact clause map, API, base-locator reasoning and representative Name XML
99 are in `docs/reading-canonical-topic-maps.md`. CXTM's explicit ยง3.1 root LF is
100 retained; generic XML-C14N after reparsing discards it. This interpretation is
101 recorded, and the byte oracle uses neither reparsing nor normalization.
102 No other discrepancy was observed for the selected 24 cases. These results
103 establish this bounded implementation against the pinned draft-era suite, not
104 full CTM, TMDM or CXTM conformity. Occurrences, Variants, nonempty Scope,
105 Reification, non-Topic identifiers and datatype canonicalization are unsupported.
106 Unicode is explicitly bounded to assigned UCD 15.1.0 characters; ambiguous
107 normalized Topic identity keys are rejected rather than silently merged.
108
109 ## Exact reproduction commands
110
111 Run with installed runtimes and Python UCD 15.0/15.1; no acquisition/network is
112 required. These are the two commands actually executed:
113
114 ```sh
115 cd /Users/rgb/workspace/topic-maps
116 '/usr/bin/sandbox-exec' '-p' '(version 1)(allow default)(deny network*)' '/usr/bin/env' 'PYTHONDONTWRITEBYTECODE=1' 'SBCL=/nix/store/hlsiblxpxr1hax3dw9x8znd6zy097ddj-sbcl-2.5.4/bin/sbcl' 'TOPIC_MAPS_REPORT=/private/tmp/ctm-slice-4-validation-5tf9f583/validation-2.5.4.json' '/Users/rgb/workspace/topic-maps/scripts/test.sh'
117 ```
118
119 ```sh
120 cd /private/tmp/ctm-slice-4-validation-5tf9f583/checkout
121 '/usr/bin/sandbox-exec' '-p' '(version 1)(allow default)(deny network*)' '/usr/bin/env' 'PYTHONDONTWRITEBYTECODE=1' 'SBCL=/nix/store/y96nx8571mpdvjd40krkdim2av0in972-sbcl-2.4.10/bin/sbcl' 'TOPIC_MAPS_REPORT=/private/tmp/ctm-slice-4-validation-5tf9f583/validation-2.4.10.json' '/private/tmp/ctm-slice-4-validation-5tf9f583/checkout/scripts/test.sh'
122 ```
123
124 The temporary relocated checkout was made by copying the checkout while excluding
125 `.git`, `__pycache__` and `*.pyc`. A new relocated directory can be substituted
126 for a later reproduction; logical Document IRIs remain the same. Reports from
127 the two commands must compare byte-for-byte, including `.cxtm.json`.
128
129 The documented inspection forms are printed in the reading document and their
130 actual output is retained in `reports/slice-4/describe.log`.
131
132 **Decision:** PASS for the requested Slice 4 subset, with the explicit LF
133 interpretation and unsupported boundaries above available for review. Stop here;
134 do not extend the CTM/TMDM model or begin another slice before review.