@@ -28,6 +28,172 @@ inventory is unchanged. `active_rate_card` remains the publication-selected
2828head; publication validation must reproduce its complete predecessor chain
2929before promotion.
3030
31+ ## CK-08R3A schema/publication transition authority
32+
33+ The canonical database-v1 contract above remains the predecessor contract
34+ until the CK-08R3A implementation is accepted. The selected EvidenceService
35+ candidate is permitted to requalify only with the exact transition below. It
36+ adds 13 evidence-order indexes, changes the resulting digest to
37+ ` e3b8509774987fb4fd9cd09aeee1ab9ee32642932ea6a07726315154409b1e35 ` , and
38+ does not authorize any other schema, publication, selector, cursor, or query
39+ semantic change. The transition is a contract fixture, not an active DDL
40+ replacement on this authority branch.
41+
42+ <!-- ck08r3a-evidence-indexes-ddl:start -->
43+ ``` sql
44+ -- CK-08R3A EvidenceService branch order. These indexes mirror the
45+ -- seven-part keyset tuple exactly, including the normalized NULL-time
46+ -- expression and the transition tie-breaker. The turn constants are part
47+ -- of the persisted stream contract for turn boundary rows.
48+ CREATE INDEX evidence_model_calls_by_session_order
49+ ON model_calls(
50+ session_id ASC ,
51+ (event_at_us IS NULL ) ASC ,
52+ COALESCE(event_at_us, 0 ) ASC ,
53+ source_rank ASC ,
54+ source_order ASC ,
55+ event_kind_order ASC ,
56+ call_id ASC ,
57+ transition_rank ASC
58+ );
59+ CREATE INDEX evidence_model_call_tail_by_session_order
60+ ON model_call_tail(
61+ session_id ASC ,
62+ (event_at_us IS NULL ) ASC ,
63+ COALESCE(event_at_us, 0 ) ASC ,
64+ source_rank ASC ,
65+ source_order ASC ,
66+ event_kind_order ASC ,
67+ call_id ASC ,
68+ transition_rank ASC
69+ );
70+ CREATE INDEX evidence_tools_by_session_order
71+ ON tool_invocations(
72+ session_id ASC ,
73+ (start_at_us IS NULL ) ASC ,
74+ COALESCE(start_at_us, 0 ) ASC ,
75+ start_source_rank ASC ,
76+ start_source_order ASC ,
77+ start_event_kind_order ASC ,
78+ tool_id ASC ,
79+ start_transition_rank ASC
80+ );
81+ CREATE INDEX evidence_activities_by_session_order
82+ ON activities(
83+ session_id ASC ,
84+ (event_at_us IS NULL ) ASC ,
85+ COALESCE(event_at_us, 0 ) ASC ,
86+ source_rank ASC ,
87+ source_order ASC ,
88+ event_kind_order ASC ,
89+ activity_id ASC ,
90+ transition_rank ASC
91+ );
92+ CREATE INDEX evidence_state_changes_by_session_order
93+ ON state_changes(
94+ session_id ASC ,
95+ (event_at_us IS NULL ) ASC ,
96+ COALESCE(event_at_us, 0 ) ASC ,
97+ source_rank ASC ,
98+ source_order ASC ,
99+ event_kind_order ASC ,
100+ change_id ASC ,
101+ transition_rank ASC
102+ );
103+ CREATE INDEX evidence_compactions_by_session_order
104+ ON compaction_boundaries(
105+ session_id ASC ,
106+ (event_at_us IS NULL ) ASC ,
107+ COALESCE(event_at_us, 0 ) ASC ,
108+ source_rank ASC ,
109+ source_order ASC ,
110+ event_kind_order ASC ,
111+ compaction_id ASC ,
112+ transition_rank ASC
113+ );
114+ CREATE INDEX evidence_context_components_by_session_order
115+ ON context_components(
116+ session_id ASC ,
117+ (event_at_us IS NULL ) ASC ,
118+ COALESCE(event_at_us, 0 ) ASC ,
119+ source_rank ASC ,
120+ source_order ASC ,
121+ event_kind_order ASC ,
122+ component_id ASC ,
123+ transition_rank ASC
124+ );
125+ CREATE INDEX evidence_turns_by_session_order
126+ ON turns(
127+ session_id ASC ,
128+ (start_at_us IS NULL ) ASC ,
129+ COALESCE(start_at_us, 0 ) ASC ,
130+ 0 ASC ,
131+ COALESCE(start_source_order, 0 ) ASC ,
132+ 20 ASC ,
133+ turn_id ASC ,
134+ 0 ASC
135+ );
136+ CREATE INDEX evidence_lifecycle_timeline_order
137+ ON lifecycle_transitions(
138+ (transition_at_us IS NULL ) ASC ,
139+ COALESCE(transition_at_us, 0 ) ASC ,
140+ source_rank ASC ,
141+ source_order ASC ,
142+ event_kind_order ASC ,
143+ transition_id ASC ,
144+ transition_rank ASC
145+ );
146+ CREATE INDEX evidence_source_occurrences_by_logical_order
147+ ON source_occurrences(
148+ semantic_logical_id ASC ,
149+ record_ordinal ASC ,
150+ byte_start ASC ,
151+ byte_end ASC ,
152+ occurrence_id ASC
153+ );
154+ CREATE INDEX evidence_tools_by_resource_order
155+ ON tool_invocations(
156+ primary_resource_id ASC ,
157+ (start_at_us IS NULL ) ASC ,
158+ COALESCE(start_at_us, 0 ) ASC ,
159+ start_source_rank ASC ,
160+ start_source_order ASC ,
161+ start_event_kind_order ASC ,
162+ tool_id ASC ,
163+ start_transition_rank ASC
164+ )
165+ WHERE primary_resource_id IS NOT NULL ;
166+ CREATE INDEX evidence_state_changes_by_resource_order
167+ ON state_changes(
168+ resource_id ASC ,
169+ (event_at_us IS NULL ) ASC ,
170+ COALESCE(event_at_us, 0 ) ASC ,
171+ source_rank ASC ,
172+ source_order ASC ,
173+ event_kind_order ASC ,
174+ change_id ASC ,
175+ transition_rank ASC
176+ );
177+ CREATE INDEX evidence_allowance_observations_order
178+ ON allowance_observations(
179+ (observed_at_us IS NULL ) ASC ,
180+ COALESCE(observed_at_us, 0 ) ASC ,
181+ source_rank ASC ,
182+ source_order ASC ,
183+ event_kind_order ASC ,
184+ observation_id ASC ,
185+ transition_rank ASC
186+ );
187+ ```
188+ <!-- ck08r3a-evidence-indexes-ddl:end -->
189+
190+ The selected block is composed after the canonical ` analytical-ddl ` payload
191+ and before the unchanged operational payload only when the linked
192+ schema/publication authority is accepted. Its exact 57-index inventory,
193+ publication manifest bindings, frozen synthetic fixture digests, and the
194+ tiny-accounting covering-index expectation are recorded in
195+ ` docs/decisions/evidence/ck08r3a/schema-publication-requalification-authority.json ` .
196+
31197## Contract boundaries
32198
33199The analytical artifact and operational sidecar are separate SQLite databases.
0 commit comments