mostlyright-data 0.31.33__tar.gz → 0.31.34__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 (131) hide show
  1. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/PKG-INFO +1 -1
  2. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/SKILL.md +2 -0
  3. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/6-build-one-run-sized-to-acquire-every-measured-source-whole.md +9 -0
  4. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/commands.md +2 -2
  5. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/making-a-table-incremental.md +20 -10
  6. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/predicting-with-tabular-models.md +37 -10
  7. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/readers.md +4 -4
  8. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/satellite-signals.md +1 -1
  9. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/enrichment.py +7 -1
  10. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/recipe.py +4 -1
  11. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/recipe_explain.py +67 -0
  12. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/recipe_lint.py +393 -13
  13. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/table_search_contract.json +1 -1
  14. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4.py +2 -2
  15. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_tables.py +41 -12
  16. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/.gitignore +0 -0
  17. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/README.md +0 -0
  18. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/pyproject.toml +0 -0
  19. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/scripts/hatch_build.py +0 -0
  20. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/agents/openai.yaml +0 -0
  21. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/1-open-the-page-and-the-link-to-it-in-the-first-message.md +0 -0
  22. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/2-brief-two-to-four-questions-each-with-a-recommended-answer.md +0 -0
  23. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/3-probe-read-a-source-before-committing-to-it.md +0 -0
  24. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/4-decide-say-what-you-chose-what-you-refused-and-ask-one-question.md +0 -0
  25. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/5-draft-one-recipe-document-one-call.md +0 -0
  26. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/7-interrogate-ask-the-run-what-it-actually-delivered.md +0 -0
  27. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/8-fix-revise-the-document-and-register-it-again.md +0 -0
  28. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/9-present-only-what-survived-inspection-with-caveats.md +0 -0
  29. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/agent-protocol.md +0 -0
  30. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/autonomous-delivery.md +0 -0
  31. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/before-the-first-tool-call.md +0 -0
  32. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/boundaries.md +0 -0
  33. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/cloud-authentication-preflight.md +0 -0
  34. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/enriching-with-small-models.md +0 -0
  35. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/live-run.md +0 -0
  36. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/narrating-the-run.md +0 -0
  37. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/not-hosted-yet.md +0 -0
  38. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/one-install.md +0 -0
  39. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/patterns.md +0 -0
  40. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/prediction-labels.md +0 -0
  41. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/preparing-table-search.md +0 -0
  42. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/promote.md +0 -0
  43. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/receipts.md +0 -0
  44. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/recipe-test.md +0 -0
  45. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/recording-a-stream-venue.md +0 -0
  46. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/recovering-an-import-failure.md +0 -0
  47. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/reference-pages.md +0 -0
  48. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/required-protocol.md +0 -0
  49. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/source-credentials.md +0 -0
  50. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/sources.md +0 -0
  51. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/the-one-thing-to-say-about-the-skill-itself.md +0 -0
  52. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/transforms.md +0 -0
  53. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/user-communication-contract.md +0 -0
  54. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/references/writing-a-decision-record.md +0 -0
  55. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/skills/mr-data-build/scripts/write_research_notebook.py +0 -0
  56. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/__init__.py +0 -0
  57. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/agent_protocol.py +0 -0
  58. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/canonical.py +0 -0
  59. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/key_seam.py +0 -0
  60. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/page_coverage.py +0 -0
  61. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/part_check_evidence.py +0 -0
  62. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/session_probes.py +0 -0
  63. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/skill_assets.py +0 -0
  64. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/table_manifest.py +0 -0
  65. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/__init__.py +0 -0
  66. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/activity.py +0 -0
  67. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/backoff.py +0 -0
  68. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/categories.py +0 -0
  69. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/dataset-categories-v1.json +0 -0
  70. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/dataset_layout.py +0 -0
  71. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/delivery.py +0 -0
  72. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/description_shape.py +0 -0
  73. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/download.py +0 -0
  74. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/fast_features.py +0 -0
  75. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/matching_benchmark.py +0 -0
  76. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/probe.py +0 -0
  77. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/progress_rate.py +0 -0
  78. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/progress_vocabulary.py +0 -0
  79. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/recipe_brief.py +0 -0
  80. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/recipe_forecast.py +0 -0
  81. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/recipe_test.py +0 -0
  82. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/refresh_rehearsal.py +0 -0
  83. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/release_check.py +0 -0
  84. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/research.py +0 -0
  85. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/router.py +0 -0
  86. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/run_diagnose.py +0 -0
  87. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/run_prefix.py +0 -0
  88. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/runs.py +0 -0
  89. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/session.py +0 -0
  90. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/stream.py +0 -0
  91. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/stream_venue.py +0 -0
  92. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/studio_capabilities.py +0 -0
  93. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/support.py +0 -0
  94. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/table_view.py +0 -0
  95. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/transport.py +0 -0
  96. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/user_agent.py +0 -0
  97. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_artifacts.py +0 -0
  98. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_catalog.py +0 -0
  99. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_connected.py +0 -0
  100. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_connections.py +0 -0
  101. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_dataset_covers.py +0 -0
  102. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_datasets.py +0 -0
  103. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_handoff.py +0 -0
  104. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_matching.py +0 -0
  105. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_narrative.py +0 -0
  106. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_public.py +0 -0
  107. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_query.py +0 -0
  108. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_reader.py +0 -0
  109. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_runs.py +0 -0
  110. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_search.py +0 -0
  111. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_search_contract.py +0 -0
  112. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_secrets.py +0 -0
  113. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/v4_stream.py +0 -0
  114. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/thin/vocabulary.py +0 -0
  115. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/__init__.py +0 -0
  116. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/attendance.py +0 -0
  117. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/clarification.py +0 -0
  118. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/cloud_auth.py +0 -0
  119. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/commands/__init__.py +0 -0
  120. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/commands/auth.py +0 -0
  121. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/commands/clarify.py +0 -0
  122. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/commands/login.py +0 -0
  123. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/commands/whoami.py +0 -0
  124. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/credential_native.py +0 -0
  125. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/credential_store.py +0 -0
  126. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/credentials.py +0 -0
  127. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/login.py +0 -0
  128. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/path_kind.py +0 -0
  129. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/plain_file.py +0 -0
  130. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/src/mostlyright/data_harness/ux/remediation.py +0 -0
  131. {mostlyright_data-0.31.33 → mostlyright_data-0.31.34}/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.33
3
+ Version: 0.31.34
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/
@@ -175,6 +175,8 @@ step 6. The stage 3 reference holds its rule. Gate 4 is step 6.
175
175
  The server returns the recipe digest; do not compute or invent it.
176
176
  Decide how each source continues before you register it, and whether the table needs a
177
177
  declared `rebuild`: read [making a table incremental](references/making-a-table-incremental.md).
178
+ A `rebuild` states `max_rebuild_bytes` at least the sum of the sources' `max_source_bytes`, or
179
+ every scheduled rebuild is held.
178
180
  Run `mr-data recipe explain RECIPE.json --json` first. It names every reason the table could
179
181
  not refresh, not only the first. Its `fast_features` has eight entries, and each missed one
180
182
  carries a one-line fix. Write `table.partition` for any table no window partitions that
@@ -185,6 +185,15 @@ preflight does not refuse a large one. Registration puts one sentence on the rec
185
185
  sentence names the route, the ceiling it used and the formats that stop earlier. Read that as "go
186
186
  and check this one", not as a failure.
187
187
 
188
+ Once a full has measured a source, set its ceiling at about 1.5 to 4 times the `bytes_fetched` the
189
+ receipt reports. A table that declares `rebuild` states `max_rebuild_bytes` at least the sum of
190
+ every source's ceiling, because a scheduled rebuild is projected from the ceilings, not from the
191
+ forecast of past runs. `mr-data recipe` and `recipe explain` check that sum locally and warn.
192
+ After registering, run `mr-data recipe forecast RECIPE_ID --digest DIGEST` and compare
193
+ `totals.projected_bytes` with `max_rebuild_bytes` before you promote: promotion arms the
194
+ schedule, and under the projection every scheduled rebuild is held
195
+ ([rebuild](making-a-table-incremental.md#rebuild-the-fifth-continuation)).
196
+
188
197
  **Which remedy applies depends on which way the source is too big, and lowering the ceiling is
189
198
  never it** — that truncates the preview or refuses the full build rather than fetching less. A WIDE
190
199
  source is narrowed by projecting fewer columns in the reader's own settings; splitting it would not
@@ -17,7 +17,7 @@ run in full.
17
17
  | `mr-data clarify` | Check whether clarification is allowed. Use `--attended` for an active user chat and `--unattended` for a scheduled invocation; an explicit operator veto such as `MOSTLYRIGHT_ATTENDED=0` still wins. A non-TTY subprocess does not prove the user is absent. The command does not ask the person in chat or wait for a reply; the agent must do that. It exits non-zero when nobody can answer or the recipe is already registered. |
18
18
  | `mr-data probe` | `probe SOURCE_ID QUESTION_ID --dataset DATASET_ID [--kind source_inspect\|sample_rows\|profile_columns\|evaluate_expression]` asks one already-registered source one question and prints the answer. **It rides the frozen `/v3/sessions` routes, which a deployment may have switched off, so do not plan a source inspection around it.** Both positionals are identifiers. `QUESTION_ID` is a question identifier, which no v4 registration receipt returns. The v4 way to look at a source before registering it is `mr-data source inspect`, in the next row. The other way to read one is a bounded run of a scratch table, never of the real table, as [the probe rule](3-probe-read-a-source-before-committing-to-it.md#the-probe-rule-test-on-a-scratch-table-never-on-the-real-table) says. |
19
19
  | `mr-data source` | `source inspect` takes a bounded look at one source, and it is the v4 path where `probe` is not. [Stage 3](3-probe-read-a-source-before-committing-to-it.md) says when to use it. It starts one of three ways, and each prints the `session_id`, `probe_id` and `source_id`, plus the `dataset_id` and `question_id` when it has them. For a new public HTTPS CSV that needs no key, give `--dataset-id`, `--question`, `--source-name`, `--source-url`, `--claimed-basis` and `--claim-evidence-digest`: it prepares the source and opens a session. For a source already prepared, give `--dataset-id`, `--question-id` and `--source-id`, which opens a session. In a session you already hold, give `--session-id` with `--source-id`. `--context-source-id` adds a source to a session it opens. `--session-id` with `--probe-id` reads the answer back; `--probe-id` alone is refused. A look is bounded to 65,536 bytes, 1,000 rows and 300 seconds. A larger file can fail `BYTE_LIMIT` after a wait, so read it by a bounded run of a scratch table. `queued` and `truncated` are not complete answers, and `capability_unavailable` means this deployment cannot inspect, so read the source by a bounded run of a scratch table instead, as [the probe rule](3-probe-read-a-source-before-committing-to-it.md#the-probe-rule-test-on-a-scratch-table-never-on-the-real-table) says. What it finds is exploratory evidence, not a run and not a receipt. |
20
- | `mr-data reader` | `reader normalize --family-id ID --family-version VERSION --options-file FILE [--workspace-id ID]` asks the server's Reader service to apply one certified family's own defaults and option rules to a JSON object of options, at most 64 KiB, and prints the normalized `decode_options`, `decode_options_json` and `options_digest`. The second is the text a recipe carries as `reader.decode_options`, and the third is the `reader.options_digest` registration accepts for exactly those options, pinned as [Readers](readers.md) describes. It changes nothing, and this client does not validate or invent a family's options: the server decides. Run it for every Reader pin before you register, so a wrong option is refused here and not inside a run. |
20
+ | `mr-data reader` | `reader normalize --family-id ID --family-version VERSION --options-file FILE [--workspace-id ID]` asks the server's Reader service to apply one certified family's own defaults and option rules to a JSON object of options, at most 64 KiB, and prints the normalized `decode_options`, `decode_options_json` and `options_digest`. The second is the text a recipe carries as `reader.decode_options`, and the third is the `options_digest` a Generic API's `generic_api.response.reader` states for exactly those options. A connector pin takes no `reader.options_digest` parameter ([Readers](readers.md)). It changes nothing, and this client does not validate or invent a family's options: the server decides. Run it for every Reader pin before you register, so a wrong option is refused here and not inside a run. |
21
21
  | `mr-data catalog` | `catalog search "QUESTION"` asks the sealed public-source catalogue which of its entries might answer a question and ranks them best first. Every ranked entry comes back with the disposition its own facts earned — `admitted`, `human_escalation_required` or `refused` — because an entry the catalogue could not vouch for is still a finding. `--format csv` states the one data format the question requires — one token per question, never repeated — and it is not a filter: an entry that does not declare that format still comes back ranked, with disposition `refused` and `filters_match` false, so nothing is held back; `--limit N` ranks at most N, up to 25. It fetches nothing and registers nothing. The catalogue holds one provider (Data.gov) and only part of it, so it is never exhaustive and an empty answer is not evidence that no such source exists. When the answer is `catalog_unavailable`, this deployment has no catalogue to search: record the lane and carry on. |
22
22
  | `mr-data public` | Read Mostly Right's public dataset catalogue. `public search "QUERY"` ranks published datasets (`--topic`, `--limit` and `--cursor` narrow and page it), `show SLUG` reads one overview, `tables SLUG` lists its table identifiers, `schema TABLE_ID` reads one table's schema, `sample TABLE_ID` prints its published preview rows, `lookup "QUERY"` is the connector search shape and `fetch SLUG` returns the dataset's Markdown document. Those seven need no login. `query TABLE_ID`, with `--body` or `--body-file`, and `download-url TABLE_ID` do need `mr-data login`: they ask Cloud, with the device key, to run one query over a public table and to say how it can be downloaded. Preview rows are not a query, and no table bytes pass through the command. |
23
23
  | `mr-data connected` | `connected list` shows the public datasets connected to this workspace and `connected add SLUG` connects one by its slug. It needs `mr-data login`: both ask Cloud, with the device key, over the routes MCP's `list_connected_datasets` and `connect_dataset` use. |
@@ -47,7 +47,7 @@ run in full.
47
47
  | `mr-data open` | Mint a single-use, short-lived address that continues this session in a browser at one dashboard path, and print it. `--open` hands it to the platform opener. The credential decides who mints: a device credential — what `mr-data login` stores — mints at Cloud, and a personal access token mints at the server. |
48
48
  | `mr-data promote` | Record the cadence one table refreshes on and the reasoning behind it. A table's first succeeded run goes live on its own, so this is not what makes it readable; it is idempotent on a table that is already live, and it is how a withdrawn table is put back. The worker does not perform the catch-up or scheduled refresh; report those only when another deployed component returns durable evidence that it did. |
49
49
  | `mr-data reschedule` | Change how often one live table refreshes, without the demote and promote that would reset its bookkeeping and buy a catch-up run. `--cadence` takes a cron expression or an interval such as `every 6h`; `--why` records the reasoning. It starts no run. `--lock` freezes the schedule so the server stops adjusting it; `--unlock` lets it follow the source again. A table that cannot refresh answers `table_schedule_held` and exits 2, naming the two repairs: declare `rebuild`, or `table resync`. |
50
- | `mr-data table` | Report what one table is serving and how its refresh schedule is going: the state in plain words, the schedule in force, the next refresh, the schedule that was asked for and the reason given for it, and — once the server has settled on one — the interval it measured and how many source updates that rests on. Where the server reports it, it also prints the table's refresh strategy: "rebuilds every 7d; next T" or "held: blocker". `table rename TABLE --name NAME` writes a new name, lowercase snake_case and unique within its dataset, fenced on that dataset's version and retried once if somebody else wrote first; nothing is rebuilt, because every run, version and schedule hangs off the identifier, which does not move. `table archive TABLE --confirm-name NAME` retires one table you name by the name it is called, and frees that name; a live table is refused until you `demote` it, and nothing built is deleted. `table archive TABLE [TABLE ...] --confirm DELETE` retires as many tables as you name at once: `DELETE` is the literal word, typed exactly, and it confirms the identifiers you typed rather than a name, so each table is retired under the name the server is holding for it. Every table is attempted whatever the one before it answered, one line is printed for each, and the command exits non-zero if any was not retired — so read the outcome of each rather than the exit code alone. `--confirm-name` is refused when you name more than one table. `table view TABLE` says whether a live table has a saved view (`view_saved`) and lists the view kinds (`table`, `cards`, `places`, `products`, `events`, `jobs`, `people`, `articles`) and the roles each binds. There is no map or chart kind, and `places` are location cards. `table view TABLE --set VIEW.json` saves `{"version": 1, "template": KIND, "fields": {ROLE: COLUMN}}`, with optional `facts` (up to 4 columns) and `imageStyle`. `--dry-run` has Cloud validate it against the live table and save nothing. The file is checked here before anything is sent. Replacing a saved view needs its revision as `--expected-revision`, which MCP `get_table` reports, because Cloud serves no CLI read of it. A stale revision is refused `THIN_TABLE_VIEW_VIEW_CHANGED`. The command uses the device key. When the newest version is held from live, `table show` says `The newest version X is held: <reason>; serving Y`. `table accept-version TABLE --version VERSION_ID` releases that hold; live then derives from the newest unheld version. |
50
+ | `mr-data table` | Report what one table is serving and how its refresh schedule is going: the state in plain words, the schedule in force, the next refresh, the schedule that was asked for and the reason given for it, and — once the server has settled on one — the interval it measured and how many source updates that rests on. Where the server reports it, it also prints the table's refresh strategy: "rebuilds at most every 7d, schedule every 6 hours; next T", "rebuild held by its budget since T: projected N bytes exceeds max_rebuild_bytes M; …; next try T" (with `rebuild_held` in the JSON) or "held: blocker". `table rename TABLE --name NAME` writes a new name, lowercase snake_case and unique within its dataset, fenced on that dataset's version and retried once if somebody else wrote first; nothing is rebuilt, because every run, version and schedule hangs off the identifier, which does not move. `table archive TABLE --confirm-name NAME` retires one table you name by the name it is called, and frees that name; a live table is refused until you `demote` it, and nothing built is deleted. `table archive TABLE [TABLE ...] --confirm DELETE` retires as many tables as you name at once: `DELETE` is the literal word, typed exactly, and it confirms the identifiers you typed rather than a name, so each table is retired under the name the server is holding for it. Every table is attempted whatever the one before it answered, one line is printed for each, and the command exits non-zero if any was not retired — so read the outcome of each rather than the exit code alone. `--confirm-name` is refused when you name more than one table. `table view TABLE` says whether a live table has a saved view (`view_saved`) and lists the view kinds (`table`, `cards`, `places`, `products`, `events`, `jobs`, `people`, `articles`) and the roles each binds. There is no map or chart kind, and `places` are location cards. `table view TABLE --set VIEW.json` saves `{"version": 1, "template": KIND, "fields": {ROLE: COLUMN}}`, with optional `facts` (up to 4 columns) and `imageStyle`. `--dry-run` has Cloud validate it against the live table and save nothing. The file is checked here before anything is sent. Replacing a saved view needs its revision as `--expected-revision`, which MCP `get_table` reports, because Cloud serves no CLI read of it. A stale revision is refused `THIN_TABLE_VIEW_VIEW_CHANGED`. The command uses the device key. When the newest version is held from live, `table show` says `The newest version X is held: <reason>; serving Y`. `table accept-version TABLE --version VERSION_ID` releases that hold; live then derives from the newest unheld version. |
51
51
  | `mr-data pin` | Ask the server to freeze one table pointer on an exact version, for a rollback or a hold. |
52
52
  | `mr-data unpin` | Ask the server to resume pointer tracking; read the returned state before claiming it resumed. |
53
53
  | `mr-data demote` | Ask the server to withdraw the pointer and any schedule it owns, for one table or for as many as you name: `demote TABLE [TABLE ...]` withdraws them one after another, attempts every one of them whatever the one before it answered, prints a line for each, and exits non-zero if any is still live. Pair it with `table archive` when you are retiring a set: a live table cannot be archived, so it is withdraw-then-archive, two commands rather than a loop. |
@@ -233,12 +233,19 @@ full read:
233
233
 
234
234
  - **Use it** when the table must stay current, `mr-data recipe explain` reports a blocker no
235
235
  design repair removes, and a whole re-read at the chosen interval is affordable.
236
- - **Size `max_rebuild_bytes` at 1.5 times a measured run.** Take the bytes the last full acquired:
237
- the sum of `bytes_fetched` over the receipt's sources, or `totals.projected_bytes` in
238
- `mr-data recipe forecast`. If they sum to 180 MB, state 270,000,000. The server starts a scheduled
239
- rebuild without a size confirmation only while its projected acquisition fits inside this
240
- number. A revision that grows past it is refused `REBUILD_BUDGET_EXCEEDED` before any run
241
- exists.
236
+ - **Size `max_rebuild_bytes` from the declared ceilings, not from a run.** The server projects a
237
+ scheduled rebuild from each source's `limits.max_source_bytes`, lowered only by evidence it reads
238
+ such as a table source's pinned version, never by the forecast of past runs. It starts the
239
+ rebuild without a size confirmation only while that projection fits inside this number.
240
+ First size each source's ceiling at about 1.5 to 4 times its measured bytes (`bytes_fetched` in
241
+ the receipt). Then state `max_rebuild_bytes` at least the sum of those ceilings;
242
+ `mr-data recipe` and `recipe explain` check the sum locally and warn. After registering, run
243
+ `mr-data recipe forecast RECIPE_ID --digest DIGEST` and compare `totals.projected_bytes` with
244
+ `max_rebuild_bytes` before you promote: registration starts no scheduled rebuild, promotion
245
+ arms it. Three sources
246
+ declared at 100,000,000, 60,000,000 and 110,000,000 need at least 270,000,000. Under the sum,
247
+ every scheduled rebuild is held `REBUILD_BUDGET_EXCEEDED` and starts no run; `mr-data recipe`
248
+ and `recipe explain` warn with both numbers.
242
249
  - **`min_interval_seconds`** is from 3,600 to 31,536,000. Choose it from how often the source
243
250
  changes and from the brief's agreed cadence. The server applies the larger of it and the platform
244
251
  refetch floor.
@@ -252,9 +259,12 @@ full read:
252
259
  per-row source whose answers change over time.
253
260
 
254
261
  `mr-data table show TABLE_ID --json` prints the strategy the server reports for the table, such as
255
- "rebuilds on 30 6 * * * (UTC); minimum interval 1h; next T" or "held: blocker".
256
- The minimum interval is a floor, not the actual schedule. When the server reports a retry of a failed rebuild, it
257
- prints that too ("retry 1/3 at T"). `mr-data reschedule` on a table that cannot refresh answers
262
+ "rebuilds at most every 1h, schedule 30 6 * * * (UTC); next T" or "held: blocker".
263
+ The schedule is when the server looks; a look inside the minimum interval waits for it. When the
264
+ server reports a retry of a failed rebuild, it prints that too ("retry 1/3 at T"). When the budget
265
+ held the last rebuild, the line starts "rebuild held by its budget" with both numbers, and
266
+ `rebuild_held` carries them: raise `max_rebuild_bytes` or lower the ceilings, and register the
267
+ revision. `mr-data reschedule` on a table that cannot refresh answers
258
268
  `status: table_schedule_held` and exits 2. It names the two repairs: declare `rebuild`, or run
259
269
  `mr-data table resync`. Never report a held table's schedule as fixed.
260
270
 
@@ -438,7 +448,7 @@ The rewrite splits it into two tables, so each can continue the way its sources
438
448
  2. **A Form D table** holds a plain whole read of the same `all.json` address as its own
439
449
  `yc_companies_all` source, with no window, plus `formd_hits`, `formd_match` and the two closed
440
450
  extracts. It declares a weekly `rebuild`, with `min_interval_seconds` 604800 and
441
- `max_rebuild_bytes` at 1.5 times the bytes its last full acquired. `recipe explain` still
451
+ `max_rebuild_bytes` at least the sum of its sources' ceilings. `recipe explain` still
442
452
  reports `SOURCE_READS_WHOLE` and the collection findings for this table, because it cannot
443
453
  refresh. The declared rebuild is what keeps it current.
444
454
 
@@ -84,7 +84,11 @@ to a model Mostly Right runs in its own cloud project, and to no vendor.
84
84
  4. Set `task` to `regression` for a number or `classification` for a label. For a
85
85
  classification, delete the template's `output` member: only a regression takes quantiles.
86
86
  Name the target in `target.column` and each feature with `kind` `number` or `category`. A
87
- feature is never the target or a `row_key` column.
87
+ feature is never the target, a `row_key` column or another feature, and registration refuses
88
+ it. To use a key as a feature, copy it under another name in `prepare.sql`
89
+ (`f.farm_id as farm`) and name the copy. A `category` cell, a class label and a row key cell
90
+ are at most 256 characters, a number and an `order_by` cell at most 64; a longer one fails
91
+ `PREDICT_INPUT_INVALID`. Cut long text in `prepare.sql` (`left(name, 256)`).
88
92
  5. Both row sets, `training` and `rows`, take a filter, an `order_by` and a `max_rows`. Over
89
93
  `max_rows` the newest rows by `order_by` are kept, and the receipt counts the rows dropped. Keep
90
94
  `training.max_rows` x (features + 1) + `rows.max_rows` x features under `max_cells` in
@@ -99,15 +103,23 @@ to a model Mostly Right runs in its own cloud project, and to no vendor.
99
103
  `PREDICT_INPUT_INVALID`.
100
104
  8. `row_key` names one to four columns, unique among the rows to predict. Set `limits.max_requests`
101
105
  to at least one plus `retries`, and keep `retries` at 1 or more so a rebuild waits out a cold
102
- start.
106
+ start. `limits.max_source_bytes` bounds the model's answer: for a regression with three
107
+ quantiles, 4,096 bytes plus 103 a row predicted. The starters state 1,048,576, which holds
108
+ about 10,000 rows. A classification's rows are larger: with 10 labels of L ASCII characters,
109
+ about 360 + 11 x L bytes each; a non-ASCII character costs 7, an emoji 14. An answer over the
110
+ ceiling fails `PREDICT_INPUT_EXCEEDS_LIMIT`. Do not raise it far past the answer: every rebuild
111
+ is projected from it.
103
112
  9. Decide whether the inputs change. When they never change, the predictions never change
104
113
  either: build a fixed snapshot ([a predict table over fixed inputs](#a-predict-table-over-fixed-inputs)).
105
114
  When a sibling table promotes new rows, declare a table `rebuild` and add
106
115
  `refresh: {trigger: upstream_promoted, debounce_seconds: 900}` beside it, at the top of the
107
116
  recipe, so the predictions are recomputed when an upstream table promotes. Set
108
117
  `min_interval_seconds` from the allowance
109
- ([fit the daily allowance](#fit-the-daily-allowance)). Size `max_rebuild_bytes` to cover the
110
- sum of every source's `limits.max_source_bytes`; the first rebuild is projected from them.
118
+ ([fit the daily allowance](#fit-the-daily-allowance)). State `max_rebuild_bytes` at least the
119
+ sum of every source's `limits.max_source_bytes`, predict sources included: every scheduled
120
+ rebuild is projected from those ceilings, and under the sum each one is held. `mr-data recipe`
121
+ warns when it is. After registering, compare `totals.projected_bytes` from
122
+ `mr-data recipe forecast RECIPE_ID --digest DIGEST` with it before you promote.
111
123
 
112
124
  A sample makes one small request per predict source and counts against the allowance. The
113
125
  recipe test does not run for a recipe with a predict source, so the first full run is its test.
@@ -236,7 +248,7 @@ on every row, so both row sets order by it. The predict source, completed from t
236
248
  "output": {"quantiles_percent": [10, 50, 90]},
237
249
  "retries": 1
238
250
  },
239
- "limits": {"max_requests": 2, "max_rows": 500, "max_source_bytes": 67108864}
251
+ "limits": {"max_requests": 2, "max_rows": 500, "max_source_bytes": 1048576}
240
252
  }
241
253
  ```
242
254
 
@@ -272,6 +284,17 @@ left join generation_forecast p on p.farm_id = f.farm_id and p.hour_utc = f.hour
272
284
  cast reads it as a time. Declare `rebuild` and `refresh` at the top of the recipe as step 9 says:
273
285
  a promotion of either sibling recomputes the predictions.
274
286
 
287
+ ### Predict a ratio when sizes differ
288
+
289
+ One model often covers a region whose operators differ in size, such as wind farms of 5 MW and
290
+ 500 MW. Trained on the actual, it mostly learns which farm is large. When a provider's forecast
291
+ of the target is a feature, predict the ratio instead: in `prepare.sql`, make the target
292
+ `actual / forecast` for rows whose forecast is above a small floor, clipped in training to a
293
+ plausible range such as `least(greatest(ratio, 0), 3)`, so a near-zero forecast cannot make a
294
+ ratio of thousands. In the transform, multiply the prediction and each quantile by the forecast
295
+ back into the target's unit. Backtest the ratio model against the provider's forecast itself as
296
+ one more baseline.
297
+
275
298
  ### A predict table over fixed inputs
276
299
 
277
300
  When no input will change again, such as a file read once or an upstream table that never
@@ -508,9 +531,11 @@ A person can ask for the predictions in the same table as their data. Build it t
508
531
  predictions: the receipt's `predict` member shows `attempts` 0 and `rows.sent` 0, and no call is
509
532
  spent. The table then holds no prediction until a row appears ahead. Check that the upstream
510
533
  table holds rows ahead, and tell the person how often they arrive.
511
- - **Say that predictions change.** Every rebuild recomputes every prediction, so a past row's
512
- value can change when the model sees more data. Say so in the description. If the person needs
513
- what was predicted at the time, that is a snapshot design this page does not build. Tell them
534
+ - **Say that predictions change.** Every rebuild replaces every prediction, so a past row's
535
+ value can change when the model sees more data, and the table keeps no record of what it said
536
+ before. Say so in the description. Keeping what was predicted at the time needs a second
537
+ table whose table source reads this one with a daily snapshot, which comes with Studio
538
+ contract 4.70.0 and is not served yet. Tell the person
514
539
  and ask; never overwrite past predictions without telling them. A rebuild from unchanged inputs
515
540
  gives the same values to a relative 1e-5 (1e-6 near zero), not the same bytes, so an unchanged request can still
516
541
  seal a new version.
@@ -562,7 +587,7 @@ still counts in `usage_today.calls` in `mr-data models --json`.
562
587
  | Code | What to do |
563
588
  | --- | --- |
564
589
  | `PREDICT_INPUT_EMPTY` | No training rows. Check the `training` filter against the source's rows, spelled as the cells are. No rows to predict is not a failure. On a sample with `prepare`, the detail can name siblings the sample cut: run the full build, which reads them whole. |
565
- | `PREDICT_INPUT_INVALID` | A repeated or empty row key, one class or more than `max_classes`, an empty target in a training row, `order_by` values not spelled alike, a target or number feature that is not a finite decimal number, every row to predict featureless, a column the upstream table no longer has, or a `prepare.sql` the run refused or whose columns are not `prepare.columns` in order. The detail says which. Fix it in `prepare.sql`, the upstream table or the filters, or select rows whose features have arrived. |
590
+ | `PREDICT_INPUT_INVALID` | A repeated or empty row key, one class or more than `max_classes`, an empty target in a training row, `order_by` values not spelled alike, a cell past its length (256 characters for a category, label or key, 64 for a number or `order_by`), a target or number feature that is not a finite decimal number, every row to predict featureless, a column the upstream table no longer has, or a `prepare.sql` the run refused or whose columns are not `prepare.columns` in order. The detail says which. Fix it in `prepare.sql`, the upstream table or the filters, or select rows whose features have arrived. |
566
591
  | `PREDICT_INPUT_EXCEEDS_LIMIT` | The request is over a binding limit, or the preparation is over 2,000,000 rows, 1 GiB of text or 8 MiB in a row. Lower `max_rows` or the feature count, or select fewer rows in `prepare.sql`. |
567
592
  | `PREDICT_MODEL_REFUSED` | The model refused the request. A model it does not serve means the pin changed: copy `model` from `mr-data models --json`. Otherwise read its message, fix the input, and run again. |
568
593
  | `PREDICT_RESPONSE_INVALID` | The answer had the wrong shape. Run again once, then report it. |
@@ -594,7 +619,9 @@ Tick each one, and report any you skipped with the reason:
594
619
  - [ ] A query shows the earliest predicted row is after the latest training row, or, with no
595
620
  time order, that no row key is in both sets.
596
621
  - [ ] Over inputs that change: `rebuild.min_interval_seconds` fits the allowance for every
597
- predict source in the workspace, and `promote --why` states the arithmetic. Over fixed inputs:
622
+ predict source in the workspace, and `promote --why` states the arithmetic.
623
+ `max_rebuild_bytes` is at least the sum of every source's `limits.max_source_bytes`, and
624
+ `mr-data table show` names no budget hold. Over fixed inputs:
598
625
  no `refresh`, no schedule, and a "Fixed snapshot: no refresh" note that names the table.
599
626
  - [ ] A refreshing table holds rows ahead at every rebuild, or the person knows when it has none.
600
627
  - [ ] The dataset description passes the `delivery` check and describes every prediction column,
@@ -57,10 +57,10 @@ mr-data reader normalize --family-id json.tabular --family-version 1.1.0 \
57
57
 
58
58
  `options.json` holds the keys the source needs, at most 64 KiB. The server applies the family's own
59
59
  defaults and option rules. The answer's `decode_options_json` is the text to write as
60
- `reader.decode_options`, and its `options_digest` is the `reader.options_digest` to pin beside it.
61
- That digest binds the default-filled options the answer returns, not the subset in `options.json`,
62
- so copy both together. A refusal arrives here, before any run is spent. Run it for every
63
- Reader pin before you register.
60
+ `reader.decode_options`. A connector pin is those three parameters only: `reader.options_digest`
61
+ is refused as "not a reserved Reader pin parameter". The answer's `options_digest` belongs only in
62
+ a Generic API's `generic_api.response.reader`, beside its `decode_options`. A refusal arrives
63
+ here, before any run is spent. Run it for every Reader pin before you register.
64
64
 
65
65
  `normalize` checks the options against the family, not against the place the pin goes. A
66
66
  Generic API `generic_api.response.reader` admits fewer coordinates: `json.tabular` `1.0.0`,
@@ -370,7 +370,7 @@ listing gives, in the locator, the connector, the request and `pages.allowed_ori
370
370
  {"name": "site_area_km2", "type": "float", "nullable": true, "description": "Area of the measured footprint, in km2."}
371
371
  ]
372
372
  },
373
- "rebuild": {"mode": "whole_table", "max_rebuild_bytes": 16777216, "min_interval_seconds": 604800},
373
+ "rebuild": {"mode": "whole_table", "max_rebuild_bytes": 68157440, "min_interval_seconds": 604800},
374
374
  "sources": [
375
375
  {
376
376
  "name": "malls",
@@ -193,6 +193,12 @@ OBSERVE_PAGES_TEMPLATE: Mapping[str, Any] = {
193
193
  #: The adapter a predict source's connector names.
194
194
  PREDICT_ADAPTER = "model.predict@1.0.0"
195
195
 
196
+ #: A predict source's ``limits.max_source_bytes`` bounds the model's answer, which for a regression
197
+ #: with three quantiles is at most 4,096 bytes plus 103 a row: 55,596 for the starter's 500 rows,
198
+ #: and 1 MiB holds about 10,000. A scheduled rebuild projects every source's declared ceiling, so
199
+ #: a 64 MiB starter held the rebuilds of recipes with many predict sources.
200
+ PREDICT_SOURCE_BYTES = 1_048_576
201
+
196
202
 
197
203
  def predict_template(entry: Mapping[str, Any], model: str) -> dict[str, Any]:
198
204
  """A predict source to start from: the binding's origin and pin, placeholder columns."""
@@ -227,7 +233,7 @@ def predict_template(entry: Mapping[str, Any], model: str) -> dict[str, Any]:
227
233
  "output": {"quantiles_percent": [10, 50, 90]},
228
234
  "retries": 1,
229
235
  },
230
- "limits": {"max_requests": 2, "max_rows": 500, "max_source_bytes": 67108864},
236
+ "limits": {"max_requests": 2, "max_rows": 500, "max_source_bytes": PREDICT_SOURCE_BYTES},
231
237
  }
232
238
 
233
239
 
@@ -167,7 +167,7 @@ _BOUNDED_STREAMING_POLICY = "bounded-streaming.v1"
167
167
  FILE_DECODER_COORDINATES: frozenset[tuple[str, str]] = frozenset(
168
168
  (family, version)
169
169
  for family, versions in {
170
- "archive.gzip": ("1.0.0", "1.1.0", "2.0.0", "2.1.0"),
170
+ "archive.gzip": ("1.0.0", "1.1.0", "2.0.0", "2.1.0", "3.0.0", "4.0.0"),
171
171
  "archive.tar": ("1.0.0", "1.1.0", "3.0.0", "4.0.0"),
172
172
  "archive.zip": ("1.0.0", "1.1.0", "1.2.0", "1.3.0", "1.4.0", "1.5.0", "3.0.0", "4.0.0"),
173
173
  "delimited_text": ("1.0.0", "1.1.0", "2.0.0"),
@@ -1498,6 +1498,9 @@ def register(
1498
1498
  len(declared_sources) if isinstance(declared_sources, list) else 0,
1499
1499
  rebuild_declared=recipe_explain.declared_rebuild(document) is not None,
1500
1500
  )
1501
+ # A budget under the declared ceilings registers, and the server holds each scheduled rebuild.
1502
+ held = recipe_explain.rebuild_budget_warning(document)
1503
+ warnings += [held] if held is not None else []
1501
1504
  # THE SECOND GATE, in the same place as the first. A recipe that passed the first one can
1502
1505
  # still hold a plan Studio refuses outright, and an author who repaired the first warning by
1503
1506
  # declaring `closed` everywhere would otherwise be answered with silence.
@@ -38,6 +38,7 @@ from mostlyright.data_harness.thin import THIN_SCHEMA_PREFIX, numbered
38
38
  from mostlyright.data_harness.thin.recipe_lint import (
39
39
  KEYLESS_API_ADAPTER_ID,
40
40
  ROW_REQUEST_ADAPTER_ID,
41
+ is_table_source,
41
42
  lint_document,
42
43
  lint_refusal,
43
44
  )
@@ -542,6 +543,62 @@ def declared_rebuild(document: Mapping[str, Any]) -> Mapping[str, Any] | None:
542
543
  return declaration
543
544
 
544
545
 
546
+ def rebuild_budget(document: Mapping[str, Any]) -> dict[str, Any] | None:
547
+ """The declared rebuild budget beside the sum of the sources' declared ceilings.
548
+
549
+ ``None`` when the document declares no rebuild a reader can honour. Studio's gate projects a
550
+ scheduled rebuild from each source's ``limits.max_source_bytes``, corrected downward only by
551
+ evidence the gate reads, such as a table source's pinned upstream version, and never by the
552
+ run-history forecast (contract 4.69.0). So a budget under the sum can hold every scheduled
553
+ rebuild. ``table_source_bytes`` is the part of the sum table sources declare, which the gate
554
+ projects at their pinned version's bytes instead.
555
+ """
556
+
557
+ declaration = declared_rebuild(document)
558
+ if declaration is None:
559
+ return None
560
+ declared = tables = 0
561
+ for source in document.get("sources") or ():
562
+ limits = source.get("limits") if isinstance(source, Mapping) else None
563
+ ceiling = limits.get("max_source_bytes") if isinstance(limits, Mapping) else None
564
+ ceiling = ceiling if type(ceiling) is int and ceiling > 0 else 0
565
+ declared += ceiling
566
+ tables += ceiling if is_table_source(source) else 0
567
+ budget = declaration["max_rebuild_bytes"]
568
+ return {
569
+ "max_rebuild_bytes": budget,
570
+ "declared_source_bytes": declared,
571
+ "table_source_bytes": tables,
572
+ "fits": declared <= budget,
573
+ }
574
+
575
+
576
+ def rebuild_budget_warning(document: Mapping[str, Any]) -> str | None:
577
+ """The sentence a rebuild budget under the declared ceilings earns, or ``None``."""
578
+
579
+ budget = rebuild_budget(document)
580
+ if budget is None or budget["fits"]:
581
+ return None
582
+ declared, stated = budget["declared_source_bytes"], budget["max_rebuild_bytes"]
583
+ tables = budget["table_source_bytes"]
584
+ said = (
585
+ f"rebuild.max_rebuild_bytes is {stated:,}, and the sources' limits.max_source_bytes sum "
586
+ f"to {declared:,}. The server projects a scheduled rebuild from those declared "
587
+ "ceilings, lowered only by evidence it reads such as a table source's pinned version and "
588
+ "never by the forecast of past runs, and holds every scheduled rebuild projected over the "
589
+ "budget (REBUILD_BUDGET_EXCEEDED) without starting a run. Size each source's ceiling at "
590
+ "about 1.5 to 4 times its measured bytes, state max_rebuild_bytes at least their sum "
591
+ f"({declared:,} as declared now), and check totals.projected_bytes in mr-data recipe "
592
+ "forecast against it"
593
+ )
594
+ if tables:
595
+ said += (
596
+ f". {tables:,} of the sum is table sources, which are projected at their pinned "
597
+ "upstream version's bytes instead"
598
+ )
599
+ return said
600
+
601
+
545
602
  def inherited_window_chain(
546
603
  source: Mapping[str, Any], sources: Mapping[str, Mapping[str, Any]]
547
604
  ) -> tuple[str, tuple[Mapping[str, Any], ...]] | None:
@@ -1677,6 +1734,14 @@ def explain(args: argparse.Namespace, *, client: StudioV4Client | None = None) -
1677
1734
  f"not {requested_recipe}, so the local mirror of {requested_recipe} is not "
1678
1735
  "compared with it"
1679
1736
  )
1737
+ # The document's own budget beside its declared ceilings, whichever side explained it: the
1738
+ # gate's hold arrives only after promotion, on the first scheduled rebuild it refuses.
1739
+ budget = rebuild_budget(document)
1740
+ if budget is not None:
1741
+ receipt["rebuild_budget"] = budget
1742
+ held = rebuild_budget_warning(document)
1743
+ if held is not None:
1744
+ receipt["warnings"] = numbered("warning", [held])
1680
1745
  blocking_codes = _codes(findings, blocking=True)
1681
1746
  receipt.update(
1682
1747
  status="recipe_refresh_ready" if receipt["refresh_ready"] else "recipe_refresh_blocked",
@@ -1735,6 +1800,8 @@ __all__ = [
1735
1800
  "inherited_window_chain",
1736
1801
  "is_reference",
1737
1802
  "mirror_findings",
1803
+ "rebuild_budget",
1804
+ "rebuild_budget_warning",
1738
1805
  "registration_gate",
1739
1806
  "route_unavailable",
1740
1807
  "row_request_carried",