2424
2525DOLT_WRITE_CONFORMANCE = {
2626 "declaration_schema_id" : "openstatspec-dolt-adapter-declaration-v1" ,
27- "write_enabled" : False ,
28- "status" : "adapter_owned_concrete_declarations_required" ,
27+ "write_enabled" : True ,
28+ "status" : "packaged_exact_version_policy" ,
29+ "declaration_count" : 0 ,
30+ "declarations_available" : False ,
2931}
3032
3133
@@ -82,7 +84,7 @@ def _dolt_driver_eligible(database_url: str) -> bool:
8284def dolt_operational_write_enabled (
8385 active : Mapping [str , Any ], * , declaration_matched : bool ,
8486) -> bool :
85- """Require both exact declaration and claimed active driver for writes ."""
87+ """Require an exact write-policy match and the claimed active driver."""
8688 return declaration_matched and bool (active .get ("driver_eligible" , False ))
8789
8890
@@ -91,7 +93,12 @@ def _dolt_write_enabled(
9193 * ,
9294 active_product_version : str | None = None ,
9395) -> bool :
94- conformance = _conformance_source (source )
96+ if source is None :
97+ return (
98+ True if active_product_version is None
99+ else active_product_version .strip () in SERVER_POLICIES ["dolt" ]["claimed" ]
100+ )
101+ conformance = source
95102 if active_product_version is None :
96103 return bool (conformance .status ()["write_enabled" ])
97104 conformance .require_exact_match (
@@ -115,8 +122,8 @@ def _dolt_write_enabled(
115122 "ci" : ["MariaDB 11.4.12" , "MariaDB 11.8.8" , "MariaDB 12.3.2" ],
116123 },
117124 "dolt" : {
118- "claimed" : [],
119- "ci" : [],
125+ "claimed" : ["2.2.2" , "2.2.3" ],
126+ "ci" : ["2.2.2" , "2.2.3" ],
120127 },
121128 "postgresql" : {
122129 "claimed" : ["PostgreSQL 17.x" , "PostgreSQL 18.x" ],
@@ -131,13 +138,13 @@ def profile_declarations(
131138 dolt_conformance_source : DoltConformanceSource | None = None ,
132139) -> dict [str , dict [str , Any ]]:
133140 """Declare every profile and, optionally, one active connection."""
134- source = _conformance_source ( dolt_conformance_source )
141+ source = dolt_conformance_source
135142 active = (
136143 active_connection (database_url , dolt_conformance_source = source )
137144 if database_url else None
138145 )
139146 dolt_declaration = None
140- if active and active ["profile" ] == "dolt" :
147+ if source is not None and active and active ["profile" ] == "dolt" :
141148 try :
142149 dolt_declaration = source .require_exact_match (
143150 active_product_version = active ["raw_product_version" ],
@@ -290,7 +297,7 @@ def effective_profile(
290297 * ,
291298 dolt_conformance_source : DoltConformanceSource | None = None ,
292299) -> tuple [SqlProfile , dict [str , Any ]]:
293- """Resolve and enforce the write profile, including exact Dolt conformance ."""
300+ """Enforce the write profile and exact Dolt policy or explicit declaration ."""
294301 return _effective_profile (database_url , dolt_conformance_source , for_write = True )
295302
296303
@@ -307,7 +314,7 @@ def _effective_profile(
307314 database_url : str , dolt_conformance_source : DoltConformanceSource | None ,
308315 * , for_write : bool ,
309316) -> tuple [SqlProfile , dict [str , Any ]]:
310- source = _conformance_source ( dolt_conformance_source )
317+ source = dolt_conformance_source
311318 configured = validate_connection_url (database_url )
312319 active = active_connection (database_url , dolt_conformance_source = source )
313320 if configured is not MYSQL and active ["profile" ] != configured .name :
@@ -326,7 +333,7 @@ def _effective_profile(
326333 # write-conformance envelope or INSERT statement/packet limits.
327334 return DOLT , active
328335 dolt_declaration = None
329- if active ["profile" ] == "dolt" :
336+ if active ["profile" ] == "dolt" and source is not None :
330337 dolt_declaration = source .require_exact_match (
331338 active_product_version = active ["raw_product_version" ],
332339 specification_commit = _bound_specification_commit (),
@@ -392,13 +399,18 @@ def _profile(
392399 dolt_declaration : Mapping [str , Any ] | None = None ,
393400) -> dict [str , Any ]:
394401 dolt_envelope = name == "dolt"
402+ default_dolt = dolt_envelope and dolt_conformance_source is None
403+ dolt_supported = bool (
404+ default_dolt and active and active ["profile" ] == "dolt"
405+ and server_version_supported ("dolt" , active ["raw_product_version" ])
406+ )
395407 identifier = {
396408 "value" : profile .identifier_limit ,
397409 "unit" : "characters" if name in {"mysql" , "mariadb" } else "bytes" ,
398410 "source" : (
399411 "MySQL/MariaDB native identifier limit" if name in {"mysql" , "mariadb" }
400412 else "PostgreSQL NAMEDATALEN minus one native byte limit" if name == "postgresql"
401- else "OpenStatSpec Dolt adapter envelope pending pinned live boundary evidence "
413+ else "OpenStatSpec Dolt adapter safety envelope (not a proven server ceiling) "
402414 if dolt_envelope
403415 else "OpenStatSpec profile boundary; SQLite has no fixed native identifier limit"
404416 ),
@@ -416,7 +428,7 @@ def _profile(
416428 if dolt_envelope :
417429 adapter_envelope = {
418430 ** profile_limits ,
419- "limit_basis" : "proposed_adapter_envelope " ,
431+ "limit_basis" : "adapter_safety_envelope " ,
420432 "evidence_status" : "pending_pinned_live_conformance" ,
421433 }
422434 theoretical = {
@@ -435,15 +447,16 @@ def _profile(
435447 effective = None
436448 status = "not_connected"
437449 if active and active ["profile" ] == name and (
438- not dolt_envelope or dolt_declaration is not None
450+ not dolt_envelope or dolt_declaration is not None or dolt_supported
439451 ):
440452 effective = (
441453 dolt_effective_limits (dolt_declaration )
442454 if dolt_envelope and dolt_declaration is not None
455+ else dict (adapter_envelope ) if default_dolt
443456 else dict (theoretical )
444457 )
445458 default_source = (
446- "proposed adapter envelope pending pinned live conformance"
459+ "adapter safety envelope; full boundary conformance not claimed "
447460 if dolt_envelope else "profile theoretical engine ceiling"
448461 )
449462 sources = {
@@ -482,7 +495,9 @@ def _profile(
482495 effective ["maximum_value_bytes" ] = min (
483496 effective ["maximum_value_bytes" ], payload ,
484497 )
485- effective ["maximum_statement_bytes" ] = payload
498+ effective ["maximum_statement_bytes" ] = min (
499+ effective ["maximum_statement_bytes" ] or payload , payload ,
500+ )
486501 sources ["maximum_value_bytes" ] = "active @@max_allowed_packet worst-case payload"
487502 sources ["maximum_statement_bytes" ] = "active @@max_allowed_packet worst-case payload"
488503 status = "active_connection_mixed"
@@ -494,20 +509,25 @@ def _profile(
494509 policy = SERVER_POLICIES [name ]
495510 dolt_declarations = (
496511 _validated_dolt_declarations (dolt_conformance_source )
497- if dolt_envelope else ()
512+ if dolt_envelope and not default_dolt else ()
498513 )
499514 dolt_claimed_versions = sorted ({
500515 version
501516 for declaration in dolt_declarations
502- for version in declaration ["claimed_product_versions" ]
517+ for version in declaration .get (
518+ "claimed_product_versions" , [declaration ["active_product_version" ]],
519+ )
503520 })
504521 dolt_tested_versions = sorted ({
505522 version
506523 for declaration in dolt_declarations
507- for version in declaration ["tested_product_versions" ]
524+ for version in declaration .get (
525+ "tested_product_versions" , [declaration ["active_product_version" ]],
526+ )
508527 })
509528 dolt_status = (
510- _conformance_source (dolt_conformance_source ).status ()
529+ DOLT_WRITE_CONFORMANCE if default_dolt
530+ else _conformance_source (dolt_conformance_source ).status ()
511531 if dolt_envelope else None
512532 )
513533 return {
@@ -520,10 +540,10 @@ def _profile(
520540 "specification_commit" : SPECIFICATION_COMMIT ,
521541 "driver" : "psycopg" if name == "postgresql" else "PyMySQL" if name in MYSQL_WIRE_PROFILES else "sqlite3" ,
522542 "claimed_server_versions" : (
523- dolt_claimed_versions if dolt_envelope else policy ["claimed" ]
543+ dolt_claimed_versions if dolt_envelope and not default_dolt else policy ["claimed" ]
524544 ),
525545 "ci_tested_server_versions" : (
526- dolt_tested_versions if dolt_envelope else policy ["ci" ]
546+ dolt_tested_versions if dolt_envelope and not default_dolt else policy ["ci" ]
527547 ),
528548 "write_conformance" : (
529549 {
@@ -543,7 +563,7 @@ def _profile(
543563 ),
544564 "operational_write_enabled" : (
545565 dolt_operational_write_enabled (
546- active , declaration_matched = dolt_declaration is not None ,
566+ active , declaration_matched = dolt_declaration is not None or dolt_supported ,
547567 )
548568 if dolt_envelope and active and active ["profile" ] == name
549569 else (
@@ -599,7 +619,6 @@ def server_version_supported(
599619 "postgresql" : {(17 ,), (18 ,)},
600620 "mysql" : {(8 , 4 ), (9 , 7 )},
601621 "mariadb" : {(11 , 4 ), (11 , 8 ), (12 , 3 )},
602- "dolt" : {(2 , 2 , 2 )},
603622 }[profile ]
604623 width = len (next (iter (allowed )))
605624 return version [:width ] in allowed
0 commit comments