mostlyright-data 0.31.21__tar.gz → 0.31.22__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/PKG-INFO +1 -1
  2. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/preparing-table-search.md +3 -1
  3. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/session.py +11 -0
  4. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/table_search_contract.json +87 -7
  5. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4.py +2 -2
  6. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_public.py +5 -0
  7. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_search.py +27 -2
  8. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/remediation.py +7 -1
  9. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/.gitignore +0 -0
  10. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/README.md +0 -0
  11. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/pyproject.toml +0 -0
  12. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/scripts/hatch_build.py +0 -0
  13. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/SKILL.md +0 -0
  14. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/agents/openai.yaml +0 -0
  15. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/1-open-the-page-and-the-link-to-it-in-the-first-message.md +0 -0
  16. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/2-brief-two-to-four-questions-each-with-a-recommended-answer.md +0 -0
  17. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/3-probe-read-a-source-before-committing-to-it.md +0 -0
  18. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/4-decide-say-what-you-chose-what-you-refused-and-ask-one-question.md +0 -0
  19. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/5-draft-one-recipe-document-one-call.md +0 -0
  20. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/6-build-one-run-sized-to-acquire-every-measured-source-whole.md +0 -0
  21. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/7-interrogate-ask-the-run-what-it-actually-delivered.md +0 -0
  22. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/8-fix-revise-the-document-and-register-it-again.md +0 -0
  23. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/9-present-only-what-survived-inspection-with-caveats.md +0 -0
  24. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/agent-protocol.md +0 -0
  25. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/autonomous-delivery.md +0 -0
  26. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/before-the-first-tool-call.md +0 -0
  27. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/boundaries.md +0 -0
  28. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/cloud-authentication-preflight.md +0 -0
  29. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/commands.md +0 -0
  30. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/enriching-with-small-models.md +0 -0
  31. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/live-run.md +0 -0
  32. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/making-a-table-incremental.md +0 -0
  33. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/narrating-the-run.md +0 -0
  34. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/not-hosted-yet.md +0 -0
  35. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/one-install.md +0 -0
  36. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/patterns.md +0 -0
  37. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/prediction-labels.md +0 -0
  38. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/promote.md +0 -0
  39. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/readers.md +0 -0
  40. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/receipts.md +0 -0
  41. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/recipe-test.md +0 -0
  42. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/recording-a-stream-venue.md +0 -0
  43. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/recovering-an-import-failure.md +0 -0
  44. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/reference-pages.md +0 -0
  45. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/required-protocol.md +0 -0
  46. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/source-credentials.md +0 -0
  47. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/sources.md +0 -0
  48. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/the-one-thing-to-say-about-the-skill-itself.md +0 -0
  49. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/transforms.md +0 -0
  50. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/user-communication-contract.md +0 -0
  51. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/references/writing-a-decision-record.md +0 -0
  52. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/skills/mr-data-build/scripts/write_research_notebook.py +0 -0
  53. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/__init__.py +0 -0
  54. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/agent_protocol.py +0 -0
  55. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/canonical.py +0 -0
  56. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/key_seam.py +0 -0
  57. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/page_coverage.py +0 -0
  58. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/part_check_evidence.py +0 -0
  59. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/session_probes.py +0 -0
  60. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/skill_assets.py +0 -0
  61. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/table_manifest.py +0 -0
  62. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/__init__.py +0 -0
  63. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/activity.py +0 -0
  64. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/backoff.py +0 -0
  65. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/categories.py +0 -0
  66. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/dataset-categories-v1.json +0 -0
  67. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/delivery.py +0 -0
  68. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/description_shape.py +0 -0
  69. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/download.py +0 -0
  70. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/enrichment.py +0 -0
  71. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/fast_features.py +0 -0
  72. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/matching_benchmark.py +0 -0
  73. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/probe.py +0 -0
  74. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/progress_rate.py +0 -0
  75. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/progress_vocabulary.py +0 -0
  76. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/recipe.py +0 -0
  77. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/recipe_brief.py +0 -0
  78. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/recipe_explain.py +0 -0
  79. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/recipe_forecast.py +0 -0
  80. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/recipe_lint.py +0 -0
  81. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/recipe_test.py +0 -0
  82. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/refresh_rehearsal.py +0 -0
  83. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/release_check.py +0 -0
  84. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/research.py +0 -0
  85. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/router.py +0 -0
  86. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/run_diagnose.py +0 -0
  87. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/run_prefix.py +0 -0
  88. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/runs.py +0 -0
  89. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/stream.py +0 -0
  90. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/stream_venue.py +0 -0
  91. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/studio_capabilities.py +0 -0
  92. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/support.py +0 -0
  93. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/table_view.py +0 -0
  94. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/transport.py +0 -0
  95. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/user_agent.py +0 -0
  96. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_artifacts.py +0 -0
  97. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_catalog.py +0 -0
  98. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_connected.py +0 -0
  99. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_connections.py +0 -0
  100. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_dataset_covers.py +0 -0
  101. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_datasets.py +0 -0
  102. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_handoff.py +0 -0
  103. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_matching.py +0 -0
  104. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_narrative.py +0 -0
  105. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_query.py +0 -0
  106. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_reader.py +0 -0
  107. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_runs.py +0 -0
  108. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_search_contract.py +0 -0
  109. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_secrets.py +0 -0
  110. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_stream.py +0 -0
  111. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/v4_tables.py +0 -0
  112. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/thin/vocabulary.py +0 -0
  113. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/__init__.py +0 -0
  114. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/attendance.py +0 -0
  115. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/clarification.py +0 -0
  116. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/cloud_auth.py +0 -0
  117. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/commands/__init__.py +0 -0
  118. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/commands/auth.py +0 -0
  119. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/commands/clarify.py +0 -0
  120. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/commands/login.py +0 -0
  121. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/commands/whoami.py +0 -0
  122. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/credential_native.py +0 -0
  123. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/credential_store.py +0 -0
  124. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/credentials.py +0 -0
  125. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/login.py +0 -0
  126. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/path_kind.py +0 -0
  127. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/plain_file.py +0 -0
  128. {mostlyright_data-0.31.21 → mostlyright_data-0.31.22}/src/mostlyright/data_harness/ux/render.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mostlyright-data
3
- Version: 0.31.21
3
+ Version: 0.31.22
4
4
  Summary: Mostly Right hosted CLI for reviewed datasets
5
5
  Project-URL: Homepage, https://mostlyright.md/
6
6
  Project-URL: Documentation, https://mostlyright.md/docs/guides/cli/
@@ -361,7 +361,9 @@ mr-data search status TABLE_ID --version VERSION_ID --json
361
361
 
362
362
  Exit code 0 means a generation serves the spec. Exit code 3 means not ready yet: a build is
363
363
  running, or the version needs a build or an activation. Read `reason` before you wait.
364
- `never_built`, `not_activated` and `spec_mismatch` need an action, not time. Exit code 1 means the build failed or was cancelled. Never queue
364
+ `never_built`, `not_activated` and `spec_mismatch` need an action, not time. Exit code 1 means the build failed or was cancelled. When `preparation_state` is `ready` but `package_state` is not, the
365
+ headline names this version's package. Exit code 1 means its build failed, and exit code 3 means
366
+ it is still building. The previous version's package may serve meanwhile. Never queue
365
367
  a duplicate build while one runs. A failed build leaves the data published. Never call a table
366
368
  partly ready.
367
369
 
@@ -886,6 +886,17 @@ def cloud_refusal(
886
886
  refusal = (ThinLaneError if composed else CloudRouteAbsent)(
887
887
  "THIN_NOT_FOUND", f"{sentence}{suffix}"
888
888
  )
889
+ elif status == 429:
890
+ # The same code the token exchange gives a 429, so one retry rule covers every Cloud
891
+ # route. Cloud's ``retry-after`` rides along as ``retry_after_seconds`` below.
892
+ wait = cloud_response_metadata(status, parsed, headers or {}).get("retry_after_seconds")
893
+ stated = named or said
894
+ refusal = ThinLaneError(
895
+ "THIN_RATE_LIMITED",
896
+ f"Cloud rate limited the request to {act}"
897
+ + (f" (Cloud said: {stated})" if stated else "")
898
+ + (f". Retry after {wait} seconds" if wait is not None else ". Retry later"),
899
+ )
889
900
  elif named is not None:
890
901
  refusal = ThinLaneError(f"THIN_CLOUD_{named}", f"Cloud refused to {act} ({named})")
891
902
  else:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema_version": "mostlyright-thin-table-search-contract.v1",
3
- "source_commit": "b296c21484f40cce334e1b7c0f6c7c03b44a41e9",
3
+ "source_commit": "de54ea1f6088aa39db57828e798c2bd4e8326191",
4
4
  "recipe_search_definition": "recipe_search",
5
5
  "$defs": {
6
6
  "common.safe_integer": {
@@ -124,7 +124,7 @@
124
124
  "long_text_columns"
125
125
  ]
126
126
  },
127
- "description": "Keel's recipe reader does not admit long_text_columns yet (4.42.0): a search revision declares it."
127
+ "description": "A recipe does not declare long_text_columns yet: a search revision declares it."
128
128
  },
129
129
  {
130
130
  "not": {
@@ -206,11 +206,25 @@
206
206
  "required": [
207
207
  "phrase",
208
208
  "column",
209
- "operator",
210
- "value"
211
- ]
209
+ "operator"
210
+ ],
211
+ "if": {
212
+ "properties": {
213
+ "operator": {
214
+ "enum": [
215
+ "is_null",
216
+ "is_not_null"
217
+ ]
218
+ }
219
+ }
220
+ },
221
+ "else": {
222
+ "required": [
223
+ "value"
224
+ ]
225
+ }
212
226
  },
213
- "description": "Filter phrases (4.45.0: at most 512). The aliases and sort aliases together take at most 196,608 bytes as compact UTF-8 JSON, which Studio's registration holds. A recipe's `table.search` may declare at most 128 aliases and 64 sort aliases while the pinned engine reads no more; a search revision takes the full budget."
227
+ "description": "Filter phrases (4.45.0: at most 512). The aliases and sort aliases together take at most 196,608 bytes as compact UTF-8 JSON, which the server's registration holds. A recipe's `table.search` may declare at most 128 aliases and 64 sort aliases while the pinned engine reads no more; a search revision takes the full budget. A null test (`is_null`, `is_not_null`) may leave out `value` (4.59.0); every other operator carries one."
214
228
  },
215
229
  "sort_aliases": {
216
230
  "type": "array",
@@ -553,7 +567,7 @@
553
567
  }
554
568
  },
555
569
  "long_text_columns": {
556
- "description": "Long string columns (4.42.0) whose text is searched by meaning, Mojirama's subtitles: plot synopses, descriptions, dialogue. Each row's text is cut into chunks, embedded and averaged into one vector per row in the package's `media.long_text`, and a plan's `long_text` ranks with it. Declared columns of type string; a public table only (Studio declares no media for another). Admitted on a search revision; a recipe's `table.search` may not name it yet.",
570
+ "description": "Long string columns (4.42.0) whose text is searched by meaning, Mojirama's subtitles: plot synopses, descriptions, dialogue. Each row's text is cut into chunks, embedded and averaged into one vector per row in the package's `media.long_text`, and a plan's `long_text` ranks with it. Declared columns of type string; a public table only (the server declares no media for another). Admitted on a search revision; a recipe's `table.search` may not name it yet.",
557
571
  "type": "array",
558
572
  "minItems": 1,
559
573
  "maxItems": 4,
@@ -563,6 +577,72 @@
563
577
  "minLength": 1,
564
578
  "maxLength": 128
565
579
  }
580
+ },
581
+ "keyword_roles": {
582
+ "description": "Optional (4.58.0): the lexical role of a keyword column, keyed by the column, each key one of keyword_columns. A role sets the column's field in the engine and with it its weight: title 3, person 2, brand and meta 1.7 (a brand column is also an entity column for the brand role's lookups), body 1. A keyword column with no entry keeps the role the server's declaration gives it today (title for the title role, person or brand for those roles' columns, else body). Declared by the catalog spec (contracts/fixtures/v4/catalog-search.spec.json); a table search revision that states it is accepted and the table declaration builder does not read it yet.",
583
+ "type": "object",
584
+ "maxProperties": 16,
585
+ "propertyNames": {
586
+ "type": "string",
587
+ "minLength": 1,
588
+ "maxLength": 128
589
+ },
590
+ "additionalProperties": {
591
+ "enum": [
592
+ "title",
593
+ "person",
594
+ "brand",
595
+ "meta",
596
+ "body"
597
+ ]
598
+ }
599
+ },
600
+ "column_notes": {
601
+ "description": "Optional (4.58.0): the owner's note for a declared column, in place of the recipe column description the manifest's column_notes copy for a table (the catalog has no recipe). Each column is a declared column of this spec; a note is 1 to 160 characters without control characters, at most 480 UTF-8 bytes, at most one per column. The manifest carries them as column_notes, under its existing byte caps.",
602
+ "type": "array",
603
+ "maxItems": 96,
604
+ "items": {
605
+ "type": "object",
606
+ "additionalProperties": false,
607
+ "properties": {
608
+ "column": {
609
+ "type": "string",
610
+ "minLength": 1,
611
+ "maxLength": 128
612
+ },
613
+ "note": {
614
+ "type": "string",
615
+ "minLength": 1,
616
+ "maxLength": 160,
617
+ "pattern": "^[^\\u0000-\\u001F]+$"
618
+ }
619
+ },
620
+ "required": [
621
+ "column",
622
+ "note"
623
+ ]
624
+ }
625
+ },
626
+ "collapse": {
627
+ "description": "Optional (4.58.0): collapse ranked rows to one result per distinct value of `column` (a display column): the best row of a group answers for it and at most `matched_via_max` other matching rows of the group are listed with it. Declared by the catalog spec (column dataset_id); the manifest carries it as catalog.collapse, and only the catalog result shape (catalog-search-result.schema.json) answers collapsed groups. A table search revision that states it is accepted and ignored.",
628
+ "type": "object",
629
+ "additionalProperties": false,
630
+ "properties": {
631
+ "column": {
632
+ "type": "string",
633
+ "minLength": 1,
634
+ "maxLength": 128
635
+ },
636
+ "matched_via_max": {
637
+ "type": "integer",
638
+ "minimum": 0,
639
+ "maximum": 8
640
+ }
641
+ },
642
+ "required": [
643
+ "column",
644
+ "matched_via_max"
645
+ ]
566
646
  }
567
647
  },
568
648
  "required": [
@@ -147,8 +147,8 @@ from mostlyright.data_harness.thin.v4_matching import CONTRACT_PATHS as MATCHING
147
147
  #: ``JOB_INVALID`` outright, which in production was every refresh a collection epoch was offered
148
148
  #: for rather than only the collection runs. This package must not reach a Studio older than the
149
149
  #: commit it pins; ``docs/V4-WORKER-PROTOCOL.md`` states it beside the layout's own ordering rule.
150
- PINNED_V4_OPENAPI_SOURCE_SHA256 = "b378d4f70d580aed094b00edeec5acc39cae5c79f19dc4e869fe40304fccf654"
151
- PINNED_V4_CONTRACT_VERSION = "4.57.0"
150
+ PINNED_V4_OPENAPI_SOURCE_SHA256 = "5c7f52ee5045ba2ebcaadd5d158a63151fcf0b39f1fe3b5563b037fec7b5d1ec"
151
+ PINNED_V4_CONTRACT_VERSION = "4.59.0"
152
152
 
153
153
  #: The ``schema_version`` every command body that predates 4.14.0 stamps: ``dataset activity``,
154
154
  #: ``table rename``, ``table archive`` and ``dataset archive``. It is the number the 0.25 line
@@ -290,6 +290,11 @@ class PublicCatalogClient:
290
290
  if relayed is not None:
291
291
  relayed.body = parsed # type: ignore[attr-defined]
292
292
  raise relayed
293
+ if status == 429:
294
+ # The rate-limit code every Cloud route gives, with Cloud's retry-after.
295
+ limited = cloud_refusal(status, parsed, act=act, headers=response_headers)
296
+ limited.body = parsed # type: ignore[attr-defined]
297
+ raise limited
293
298
  if not isinstance(parsed, dict):
294
299
  raise ThinLaneError(
295
300
  "THIN_CLOUD_REFUSED",
@@ -235,6 +235,8 @@ def search_exit_code(payload: dict[str, Any]) -> int:
235
235
  readiness = payload.get("readiness")
236
236
  if isinstance(readiness, dict) and readiness.get("preparation_state") != "ready":
237
237
  return 1 if readiness.get("reason") in {"failed", "cancelled"} else 3
238
+ if isinstance(readiness, dict) and readiness.get("package_state") not in {None, "ready"}:
239
+ return 1 if readiness.get("package_state") == "unavailable" else 3
238
240
  if result.get("status") in {"ambiguous", "clarification_required"}:
239
241
  return 4
240
242
  if result.get("status") in {
@@ -665,11 +667,20 @@ def _public_search(public_table_id: str, public: Any) -> dict[str, Any]:
665
667
  table = body.get("table") if isinstance(body, dict) else None
666
668
  capabilities = table.get("capabilities") if isinstance(table, dict) else None
667
669
  search = capabilities.get("search") if isinstance(capabilities, dict) else None
668
- if not isinstance(search, dict) or not isinstance(search.get("spec_digest"), str):
670
+ if not isinstance(search, dict):
669
671
  raise ThinLaneError(
670
672
  "THIN_SEARCH_CAPABILITY_UNAVAILABLE",
671
673
  "this table is not published with search; live search runs only on public tables",
672
674
  )
675
+ if not isinstance(search.get("spec_digest"), str):
676
+ # A revision activated after publication: ranked search serves it, the query route
677
+ # checks only the published spec.
678
+ raise ThinLaneError(
679
+ "THIN_SEARCH_CAPABILITY_UNAVAILABLE",
680
+ "this table's search is served by ranked search (mr-data search query, or the MCP "
681
+ "tool search_table). Search through the query route needs the spec published with "
682
+ "the table, and this table was published without one",
683
+ )
673
684
  return search
674
685
 
675
686
 
@@ -1867,5 +1878,19 @@ def search(
1867
1878
  )
1868
1879
  _check_table_answer(answer, table_id, body, wanted_schemas)
1869
1880
  if verb == "status":
1870
- return _payload(verb, answer, readiness=_readiness(answer))
1881
+ readiness = _readiness(answer)
1882
+ payload = _payload(verb, answer, readiness=readiness)
1883
+ # preparation_state covers the generation only. A ready generation whose package
1884
+ # failed or is still building does not serve, so the headline names the package.
1885
+ if readiness["preparation_state"] == "ready" and readiness["package_state"] not in {
1886
+ None,
1887
+ "ready",
1888
+ }:
1889
+ said = readiness["package_reason"] or readiness["package_state"]
1890
+ planner = _planner_line(answer)
1891
+ # A building package may leave the previous version's package serving.
1892
+ payload["headline"] = f"This version's search package is {said}." + (
1893
+ f" {planner}" if planner else ""
1894
+ )
1895
+ return payload
1871
1896
  return _payload(verb, answer)
@@ -11,7 +11,7 @@ neither affordable nor honest:
11
11
  * **Families.** Every code prefix is assigned to a family -- 223 of them, plus 20 compound
12
12
  prefixes, across 38 families. A family is one paragraph: what this class of failure is about,
13
13
  where to look, and what to do. Every prefix has one, so no code can fail to say something useful.
14
- * **Curated codes.** The 121 failures a person actually meets get their own exact sentences, and
14
+ * **Curated codes.** The 122 failures a person actually meets get their own exact sentences, and
15
15
  where one command is the whole answer, the command itself.
16
16
 
17
17
  Those four counts are not a note somebody remembered to update:
@@ -2308,6 +2308,12 @@ CODES: dict[str, Remediation] = {
2308
2308
  "files it already verified.",
2309
2309
  ),
2310
2310
  ),
2311
+ "THIN_RATE_LIMITED": Remediation(
2312
+ lines=(
2313
+ "Mostly Right Cloud asked this command to slow down. Nothing was changed.",
2314
+ "Wait the retry_after_seconds the message names, then run the command again.",
2315
+ ),
2316
+ ),
2311
2317
  "THIN_DATA_EGRESS_THROUGH_CLOUD": Remediation(
2312
2318
  lines=(
2313
2319
  "The server hands data to mr-data only through Mostly Right Cloud's metered routes.",