mostlyright-data 0.31.21__tar.gz → 0.31.23__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.23}/PKG-INFO +1 -1
  2. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/preparing-table-search.md +3 -1
  3. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/activity.py +4 -0
  4. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/session.py +11 -0
  5. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/table_search_contract.json +87 -7
  6. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4.py +19 -2
  7. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_datasets.py +28 -4
  8. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_public.py +5 -0
  9. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_search.py +27 -2
  10. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_tables.py +9 -1
  11. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/remediation.py +7 -1
  12. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/.gitignore +0 -0
  13. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/README.md +0 -0
  14. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/pyproject.toml +0 -0
  15. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/scripts/hatch_build.py +0 -0
  16. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/SKILL.md +0 -0
  17. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/agents/openai.yaml +0 -0
  18. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/1-open-the-page-and-the-link-to-it-in-the-first-message.md +0 -0
  19. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/2-brief-two-to-four-questions-each-with-a-recommended-answer.md +0 -0
  20. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/3-probe-read-a-source-before-committing-to-it.md +0 -0
  21. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/4-decide-say-what-you-chose-what-you-refused-and-ask-one-question.md +0 -0
  22. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/5-draft-one-recipe-document-one-call.md +0 -0
  23. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/6-build-one-run-sized-to-acquire-every-measured-source-whole.md +0 -0
  24. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/7-interrogate-ask-the-run-what-it-actually-delivered.md +0 -0
  25. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/8-fix-revise-the-document-and-register-it-again.md +0 -0
  26. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/9-present-only-what-survived-inspection-with-caveats.md +0 -0
  27. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/agent-protocol.md +0 -0
  28. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/autonomous-delivery.md +0 -0
  29. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/before-the-first-tool-call.md +0 -0
  30. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/boundaries.md +0 -0
  31. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/cloud-authentication-preflight.md +0 -0
  32. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/commands.md +0 -0
  33. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/enriching-with-small-models.md +0 -0
  34. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/live-run.md +0 -0
  35. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/making-a-table-incremental.md +0 -0
  36. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/narrating-the-run.md +0 -0
  37. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/not-hosted-yet.md +0 -0
  38. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/one-install.md +0 -0
  39. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/patterns.md +0 -0
  40. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/prediction-labels.md +0 -0
  41. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/promote.md +0 -0
  42. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/readers.md +0 -0
  43. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/receipts.md +0 -0
  44. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/recipe-test.md +0 -0
  45. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/recording-a-stream-venue.md +0 -0
  46. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/recovering-an-import-failure.md +0 -0
  47. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/reference-pages.md +0 -0
  48. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/required-protocol.md +0 -0
  49. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/source-credentials.md +0 -0
  50. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/sources.md +0 -0
  51. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/the-one-thing-to-say-about-the-skill-itself.md +0 -0
  52. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/transforms.md +0 -0
  53. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/user-communication-contract.md +0 -0
  54. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/references/writing-a-decision-record.md +0 -0
  55. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/skills/mr-data-build/scripts/write_research_notebook.py +0 -0
  56. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/__init__.py +0 -0
  57. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/agent_protocol.py +0 -0
  58. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/canonical.py +0 -0
  59. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/key_seam.py +0 -0
  60. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/page_coverage.py +0 -0
  61. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/part_check_evidence.py +0 -0
  62. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/session_probes.py +0 -0
  63. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/skill_assets.py +0 -0
  64. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/table_manifest.py +0 -0
  65. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/__init__.py +0 -0
  66. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/backoff.py +0 -0
  67. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/categories.py +0 -0
  68. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/dataset-categories-v1.json +0 -0
  69. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/delivery.py +0 -0
  70. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/description_shape.py +0 -0
  71. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/download.py +0 -0
  72. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/enrichment.py +0 -0
  73. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/fast_features.py +0 -0
  74. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/matching_benchmark.py +0 -0
  75. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/probe.py +0 -0
  76. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/progress_rate.py +0 -0
  77. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/progress_vocabulary.py +0 -0
  78. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/recipe.py +0 -0
  79. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/recipe_brief.py +0 -0
  80. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/recipe_explain.py +0 -0
  81. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/recipe_forecast.py +0 -0
  82. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/recipe_lint.py +0 -0
  83. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/recipe_test.py +0 -0
  84. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/refresh_rehearsal.py +0 -0
  85. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/release_check.py +0 -0
  86. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/research.py +0 -0
  87. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/router.py +0 -0
  88. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/run_diagnose.py +0 -0
  89. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/run_prefix.py +0 -0
  90. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/runs.py +0 -0
  91. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/stream.py +0 -0
  92. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/stream_venue.py +0 -0
  93. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/studio_capabilities.py +0 -0
  94. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/support.py +0 -0
  95. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/table_view.py +0 -0
  96. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/transport.py +0 -0
  97. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/user_agent.py +0 -0
  98. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_artifacts.py +0 -0
  99. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_catalog.py +0 -0
  100. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_connected.py +0 -0
  101. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_connections.py +0 -0
  102. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_dataset_covers.py +0 -0
  103. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_handoff.py +0 -0
  104. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_matching.py +0 -0
  105. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_narrative.py +0 -0
  106. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_query.py +0 -0
  107. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_reader.py +0 -0
  108. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_runs.py +0 -0
  109. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_search_contract.py +0 -0
  110. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_secrets.py +0 -0
  111. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/v4_stream.py +0 -0
  112. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/thin/vocabulary.py +0 -0
  113. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/__init__.py +0 -0
  114. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/attendance.py +0 -0
  115. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/clarification.py +0 -0
  116. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/cloud_auth.py +0 -0
  117. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/commands/__init__.py +0 -0
  118. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/commands/auth.py +0 -0
  119. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/commands/clarify.py +0 -0
  120. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/commands/login.py +0 -0
  121. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/commands/whoami.py +0 -0
  122. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/credential_native.py +0 -0
  123. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/credential_store.py +0 -0
  124. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/credentials.py +0 -0
  125. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/login.py +0 -0
  126. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/path_kind.py +0 -0
  127. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/src/mostlyright/data_harness/ux/plain_file.py +0 -0
  128. {mostlyright_data-0.31.21 → mostlyright_data-0.31.23}/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.23
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
 
@@ -61,6 +61,8 @@ from mostlyright.data_harness.thin.v4 import (
61
61
  COMMAND_REQUEST_VERSION_FLOOR,
62
62
  DATASET_ACTIVITY_PATH,
63
63
  DATASET_PATH,
64
+ MAX_DATASET_RESPONSE_BYTES,
65
+ MAX_DATASET_RESPONSE_MEMBERS,
64
66
  StudioV4Client,
65
67
  identifier,
66
68
  )
@@ -180,6 +182,8 @@ class StudioV4ActivityClient(StudioV4Client):
180
182
  DATASET_PATH.format(dataset_id=dataset_id),
181
183
  expected=(200,),
182
184
  response_headers=response_headers,
185
+ maximum=MAX_DATASET_RESPONSE_BYTES,
186
+ max_members=MAX_DATASET_RESPONSE_MEMBERS,
183
187
  )
184
188
  showing = record.get("activity")
185
189
  if showing is not None and not isinstance(showing, Mapping):
@@ -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
@@ -351,6 +351,20 @@ CREATE_DATASET_PATH = "/v4/datasets"
351
351
  #: silently normalised so a reader of both call sites is not left wondering which one is the typo.
352
352
  DATASET_PATH = "/v4/datasets/{dataset_id}"
353
353
 
354
+ #: The most tables ``GET`` on :data:`DATASET_PATH` serves (contract 4.60.0, was 200). Past it the
355
+ #: document says ``tables_complete: false``.
356
+ MAX_DATASET_TABLES = 1000
357
+ #: One served table at its widest. The largest real one measured on 2026-11-17 (US stocks, Kalshi
358
+ #: temperature books) was 5,155 bytes and 349 JSON members; giving it a full 256-id
359
+ #: ``promotion.stream_subscription_ids`` roster made 15,323 bytes and under 600 members.
360
+ MAX_DATASET_TABLE_BYTES = 16 * 1024
361
+ MAX_DATASET_TABLE_MEMBERS = 1024
362
+ #: The dataset read's byte and member ceilings: 1,000 worst-case tables plus the ordinary 1 MiB
363
+ #: and 100,000 members for the envelope. The default ceilings refused about 290 real tables.
364
+ #: The byte cap is what bounds memory: parsing a 17.8 MB answer peaks at about 355 MB.
365
+ MAX_DATASET_RESPONSE_BYTES = MAX_DATASET_TABLES * MAX_DATASET_TABLE_BYTES + 1024 * 1024
366
+ MAX_DATASET_RESPONSE_MEMBERS = MAX_DATASET_TABLES * MAX_DATASET_TABLE_MEMBERS + 100_000
367
+
354
368
  #: ``POST`` -- append one cell to the DATASET's decision record. ``GET`` -- read them back.
355
369
  #:
356
370
  #: ⚠ THE DATASET'S RECORD, NOT THE RUN'S, AND THE DIFFERENCE IS WHEN IT CLOSES. A run's narrative
@@ -1214,6 +1228,9 @@ __all__ = [
1214
1228
  "LIST_RUNS_PATH",
1215
1229
  "LIST_SECRETS_PATH",
1216
1230
  "LIST_TABLE_VERSIONS_PATH",
1231
+ "MAX_DATASET_RESPONSE_BYTES",
1232
+ "MAX_DATASET_RESPONSE_MEMBERS",
1233
+ "MAX_DATASET_TABLES",
1217
1234
  "PENDING_V4_PATHS",
1218
1235
  "PINNED_V4_CONTRACT_VERSION",
1219
1236
  "PIN_TABLE_PATH",
@@ -152,6 +152,9 @@ from mostlyright.data_harness.thin.v4 import (
152
152
  DATASET_PATH,
153
153
  DATASET_RECORDING_MEMBERSHIP_PATH,
154
154
  DATASET_SOURCE_INVENTORY_PATH,
155
+ MAX_DATASET_RESPONSE_BYTES,
156
+ MAX_DATASET_RESPONSE_MEMBERS,
157
+ MAX_DATASET_TABLES,
155
158
  V4_DATASET_NARRATIVE_PATH,
156
159
  StudioV4Client,
157
160
  identifier,
@@ -181,6 +184,7 @@ from mostlyright.data_harness.ux.credentials import (
181
184
  resolve_cloud_credentials,
182
185
  )
183
186
  from mostlyright.data_harness.ux.plain_file import PlainFileRefusal, read_plain_file
187
+ from mostlyright.data_harness.ux.render import STATUS_HEADLINES
184
188
 
185
189
  CREATE_SCHEMA = f"{THIN_SCHEMA_PREFIX}-v4-dataset-created.v1"
186
190
  SET_SCHEMA = f"{THIN_SCHEMA_PREFIX}-v4-dataset-updated.v1"
@@ -199,8 +203,10 @@ _CURSOR = re.compile(r"^\d{20}$")
199
203
  _MANIFEST = re.compile(r"^[A-Za-z0-9_-]*$")
200
204
  #: Studio's ``position`` maximum on ``v4/dataset.schema.json#/$defs/paged_source_inventory`` and
201
205
  #: ``#/$defs/recording_membership_page``, and the same bound ``contracts/openapi/studio-v4.yaml``
202
- #: puts on the request ``position`` of both routes: 200 x 256 = 51,200. The 200 is the active
203
- #: tables one dataset read serves (Studio's ``_TABLE_PAGE``); the 256 is the ``maxItems`` that
206
+ #: puts on the request ``position`` of both routes: 200 x 256 = 51,200. The 200 is Studio's
207
+ #: ``_TABLE_PAGE``: the tables current-state and recording membership read, and the recipes a
208
+ #: 3,200-byte ``recipe_manifest`` names. It is not what ``GET /v4/datasets/{id}`` serves, which
209
+ #: is ``thin.v4.MAX_DATASET_TABLES`` since 4.60.0. The 256 is the ``maxItems`` that
204
210
  #: ``recipe.schema.json`` puts on a recipe's ``source_ids`` and ``document.sources``, which this
205
211
  #: repository owns as ``v4_recipe.MAX_SOURCES`` (``tests/test_thin_v4_datasets.py`` holds the two
206
212
  #: equal). It moved from 12,800 (200 x 64) when Studio's read side caught up to the recipe
@@ -552,7 +558,13 @@ class StudioV4DatasetClient(StudioV4Client):
552
558
  def dataset(self, dataset_id: str) -> dict[str, Any]:
553
559
  """One dataset: its name, its description, its version, its tables and its latest run."""
554
560
 
555
- return self._call("GET", DATASET_PATH.format(dataset_id=dataset_id), expected=(200,))
561
+ return self._call(
562
+ "GET",
563
+ DATASET_PATH.format(dataset_id=dataset_id),
564
+ expected=(200,),
565
+ maximum=MAX_DATASET_RESPONSE_BYTES,
566
+ max_members=MAX_DATASET_RESPONSE_MEMBERS,
567
+ )
556
568
 
557
569
  def current_state(self, dataset_id: str, *, paged_sources: bool) -> dict[str, Any]:
558
570
  return self._call(
@@ -1450,13 +1462,25 @@ def show(
1450
1462
  def _show_receipt(
1451
1463
  client: StudioV4DatasetClient, dataset_id: str, record: Mapping[str, Any]
1452
1464
  ) -> dict[str, Any]:
1453
- return {
1465
+ receipt = {
1454
1466
  "schema_version": SHOW_SCHEMA,
1455
1467
  "status": "dataset_reported",
1456
1468
  "lane": "hosted",
1457
1469
  "dashboard_url": dataset_dashboard_url(client.session.cloud_url, dataset_id),
1458
1470
  **_projected(record),
1459
1471
  }
1472
+ # Absent from servers before 4.60.0, which cut at 200 tables without saying so.
1473
+ complete = record.get("tables_complete")
1474
+ if isinstance(complete, bool):
1475
+ receipt["tables_complete"] = complete
1476
+ if complete is False:
1477
+ tables = record.get("tables")
1478
+ shown = len(tables) if isinstance(tables, list) else MAX_DATASET_TABLES
1479
+ receipt["headline"] = (
1480
+ f"{STATUS_HEADLINES['dataset_reported']} It has more than {shown} tables and only "
1481
+ f"the first {shown}, by table id, are listed."
1482
+ )
1483
+ return receipt
1460
1484
 
1461
1485
 
1462
1486
  def state(
@@ -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)
@@ -80,6 +80,8 @@ from mostlyright.data_harness.thin.v4 import (
80
80
  GET_TABLE_PATH,
81
81
  LIST_RUNS_PATH,
82
82
  LIST_TABLE_VERSIONS_PATH,
83
+ MAX_DATASET_RESPONSE_BYTES,
84
+ MAX_DATASET_RESPONSE_MEMBERS,
83
85
  PIN_TABLE_PATH,
84
86
  PROMOTE_TABLE_PATH,
85
87
  REFRESH_TABLE_PATH,
@@ -714,7 +716,13 @@ class StudioV4TableClient(StudioV4Client):
714
716
  import that would make each of two modules depend on the other's shape.
715
717
  """
716
718
 
717
- return self._call("GET", DATASET_PATH.format(dataset_id=dataset_id), expected=(200,))
719
+ return self._call(
720
+ "GET",
721
+ DATASET_PATH.format(dataset_id=dataset_id),
722
+ expected=(200,),
723
+ maximum=MAX_DATASET_RESPONSE_BYTES,
724
+ max_members=MAX_DATASET_RESPONSE_MEMBERS,
725
+ )
718
726
 
719
727
  def cadence_observations(self, table_id: str, *, limit: int) -> list[dict[str, Any]]:
720
728
  """What each source carried on each refresh, newest first.
@@ -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.",