mostlyright-data 0.31.33__tar.gz → 0.31.35__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.35}/PKG-INFO +1 -1
  2. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/SKILL.md +3 -0
  3. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/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.35}/skills/mr-data-build/references/commands.md +2 -2
  5. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/making-a-table-incremental.md +20 -10
  6. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/predicting-with-tabular-models.md +73 -11
  7. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/readers.md +4 -4
  8. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/satellite-signals.md +1 -1
  9. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/sources.md +71 -0
  10. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/enrichment.py +7 -1
  11. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/recipe.py +7 -3
  12. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/recipe_explain.py +101 -5
  13. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/recipe_forecast.py +39 -0
  14. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/recipe_lint.py +633 -22
  15. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/studio_capabilities.py +10 -3
  16. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/table_search_contract.json +1 -1
  17. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4.py +2 -2
  18. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_connected.py +0 -1
  19. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_tables.py +78 -13
  20. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/.gitignore +0 -0
  21. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/README.md +0 -0
  22. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/pyproject.toml +0 -0
  23. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/scripts/hatch_build.py +0 -0
  24. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/agents/openai.yaml +0 -0
  25. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/1-open-the-page-and-the-link-to-it-in-the-first-message.md +0 -0
  26. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/2-brief-two-to-four-questions-each-with-a-recommended-answer.md +0 -0
  27. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/3-probe-read-a-source-before-committing-to-it.md +0 -0
  28. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/4-decide-say-what-you-chose-what-you-refused-and-ask-one-question.md +0 -0
  29. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/5-draft-one-recipe-document-one-call.md +0 -0
  30. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/7-interrogate-ask-the-run-what-it-actually-delivered.md +0 -0
  31. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/8-fix-revise-the-document-and-register-it-again.md +0 -0
  32. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/9-present-only-what-survived-inspection-with-caveats.md +0 -0
  33. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/agent-protocol.md +0 -0
  34. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/autonomous-delivery.md +0 -0
  35. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/before-the-first-tool-call.md +0 -0
  36. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/boundaries.md +0 -0
  37. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/cloud-authentication-preflight.md +0 -0
  38. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/enriching-with-small-models.md +0 -0
  39. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/live-run.md +0 -0
  40. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/narrating-the-run.md +0 -0
  41. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/not-hosted-yet.md +0 -0
  42. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/one-install.md +0 -0
  43. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/patterns.md +0 -0
  44. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/prediction-labels.md +0 -0
  45. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/preparing-table-search.md +0 -0
  46. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/promote.md +0 -0
  47. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/receipts.md +0 -0
  48. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/recipe-test.md +0 -0
  49. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/recording-a-stream-venue.md +0 -0
  50. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/recovering-an-import-failure.md +0 -0
  51. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/reference-pages.md +0 -0
  52. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/required-protocol.md +0 -0
  53. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/source-credentials.md +0 -0
  54. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/the-one-thing-to-say-about-the-skill-itself.md +0 -0
  55. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/transforms.md +0 -0
  56. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/user-communication-contract.md +0 -0
  57. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/references/writing-a-decision-record.md +0 -0
  58. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/skills/mr-data-build/scripts/write_research_notebook.py +0 -0
  59. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/__init__.py +0 -0
  60. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/agent_protocol.py +0 -0
  61. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/canonical.py +0 -0
  62. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/key_seam.py +0 -0
  63. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/page_coverage.py +0 -0
  64. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/part_check_evidence.py +0 -0
  65. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/session_probes.py +0 -0
  66. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/skill_assets.py +0 -0
  67. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/table_manifest.py +0 -0
  68. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/__init__.py +0 -0
  69. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/activity.py +0 -0
  70. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/backoff.py +0 -0
  71. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/categories.py +0 -0
  72. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/dataset-categories-v1.json +0 -0
  73. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/dataset_layout.py +0 -0
  74. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/delivery.py +0 -0
  75. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/description_shape.py +0 -0
  76. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/download.py +0 -0
  77. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/fast_features.py +0 -0
  78. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/matching_benchmark.py +0 -0
  79. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/probe.py +0 -0
  80. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/progress_rate.py +0 -0
  81. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/progress_vocabulary.py +0 -0
  82. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/recipe_brief.py +0 -0
  83. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/recipe_test.py +0 -0
  84. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/refresh_rehearsal.py +0 -0
  85. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/release_check.py +0 -0
  86. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/research.py +0 -0
  87. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/router.py +0 -0
  88. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/run_diagnose.py +0 -0
  89. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/run_prefix.py +0 -0
  90. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/runs.py +0 -0
  91. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/session.py +0 -0
  92. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/stream.py +0 -0
  93. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/stream_venue.py +0 -0
  94. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/support.py +0 -0
  95. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/table_view.py +0 -0
  96. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/transport.py +0 -0
  97. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/user_agent.py +0 -0
  98. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_artifacts.py +0 -0
  99. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_catalog.py +0 -0
  100. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_connections.py +0 -0
  101. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_dataset_covers.py +0 -0
  102. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_datasets.py +0 -0
  103. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_handoff.py +0 -0
  104. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_matching.py +0 -0
  105. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_narrative.py +0 -0
  106. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_public.py +0 -0
  107. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_query.py +0 -0
  108. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_reader.py +0 -0
  109. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_runs.py +0 -0
  110. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_search.py +0 -0
  111. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_search_contract.py +0 -0
  112. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_secrets.py +0 -0
  113. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/v4_stream.py +0 -0
  114. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/thin/vocabulary.py +0 -0
  115. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/__init__.py +0 -0
  116. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/attendance.py +0 -0
  117. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/clarification.py +0 -0
  118. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/cloud_auth.py +0 -0
  119. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/commands/__init__.py +0 -0
  120. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/commands/auth.py +0 -0
  121. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/commands/clarify.py +0 -0
  122. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/commands/login.py +0 -0
  123. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/commands/whoami.py +0 -0
  124. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/credential_native.py +0 -0
  125. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/credential_store.py +0 -0
  126. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/credentials.py +0 -0
  127. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/login.py +0 -0
  128. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/path_kind.py +0 -0
  129. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/plain_file.py +0 -0
  130. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/src/mostlyright/data_harness/ux/remediation.py +0 -0
  131. {mostlyright_data-0.31.33 → mostlyright_data-0.31.35}/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.35
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/
@@ -69,6 +69,7 @@ the source shape that fits.
69
69
  | Bulk dump beside a windowed source | `reference` | `recheck_seconds` | [reference](references/patterns.md#bulk-dump-beside-a-windowed-source) |
70
70
  | Live `wss://` feed | a recorded stream | see [Streams](references/recording-a-stream-venue.md) | none |
71
71
  | A join of tables this workspace already built, rebuilt when one promotes | `table.version@1.0.0` sources with `refresh: upstream_promoted` and `rebuild` (server 4.38) | one shared `data_classification`, `debounce_seconds` | [table sources](references/sources.md#reading-another-table-of-this-workspace) |
72
+ | A daily history of another table's rows, such as what each prediction said | one `table.version@1.0.0` source with a daily `window.snapshot` and `refresh: upstream_promoted`, no `rebuild` (server 4.70) | `max_partitions`, `max_source_bytes` for the whole horizon | [daily history](references/sources.md#keeping-a-daily-history-of-another-table) |
72
73
 
73
74
  [Patterns](references/patterns.md) has one complete recipe per row, with the pace set.
74
75
  [Sources](references/sources.md#pace-and-width) has the pace rules and the limits of parallel
@@ -175,6 +176,8 @@ step 6. The stage 3 reference holds its rule. Gate 4 is step 6.
175
176
  The server returns the recipe digest; do not compute or invent it.
176
177
  Decide how each source continues before you register it, and whether the table needs a
177
178
  declared `rebuild`: read [making a table incremental](references/making-a-table-incremental.md).
179
+ A `rebuild` states `max_rebuild_bytes` at least the sum of the sources' `max_source_bytes`, or
180
+ every scheduled rebuild is held.
178
181
  Run `mr-data recipe explain RECIPE.json --json` first. It names every reason the table could
179
182
  not refresh, not only the first. Its `fast_features` has eight entries, and each missed one
180
183
  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,53 @@ 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
+
298
+ ### Keep what each prediction said
299
+
300
+ Every rebuild replaces the predictions, so the prediction table cannot say later what it
301
+ predicted for an hour. On server 4.70 a second table can.
302
+
303
+ #### Needs server 4.70
304
+
305
+ Check first: run `mr-data recipe explain RECIPE.json --json` and read `table_source_snapshot` and `snapshot_refresh` in `studio_capabilities`. When `table_source_snapshot` is false, `mr-data recipe` refuses the recipe before registering it ("not available on this server yet"): tell the person the server does not keep such a history yet, and register nothing. When `snapshot_refresh` is false, the recipe registers with `SNAPSHOT_WILL_NOT_REFRESH_YET`, and each build keeps the one day it read: tell the person no history builds up until the server turns snapshot refresh on.
306
+
307
+ The second table's table source captures the prediction table's predicted rows once a UTC day
308
+ and keeps every day it captured. Build it in this shape:
309
+
310
+ - **Capture only.** The log has one source: a table source that reads the prediction table with
311
+ a daily `window.snapshot` and a `row_filter` that keeps the predicted rows, such as
312
+ `row_kind = 'predicted'` ([keeping a daily history of another table](sources.md#keeping-a-daily-history-of-another-table)).
313
+ Its transform casts each column and adds the capture day, which is the snapshot column. It
314
+ joins nothing and scores nothing.
315
+ - **No `rebuild`.** A rebuild would replace every captured day with one, so the server refuses
316
+ `rebuild` beside a snapshot table source. Declare `refresh: {trigger: upstream_promoted,
317
+ debounce_seconds: 900}` alone: each promotion of the prediction table starts a refresh that
318
+ appends that day's capture. The server starts at most one capture a UTC day, and a second
319
+ capture of the same day replaces it.
320
+ - **A daily cadence as the backstop.** Promote the log with `mr-data promote TABLE_ID --cadence
321
+ "every 1d" --why "captures the prediction table once a day"`. The trigger runs only after a
322
+ cadence is set, and the cadence captures a day even when the prediction table did not promote.
323
+ - **Score in a separate table.** To compare the logged predictions with the measured values,
324
+ build a third table that reads the log and the measured table as whole table sources, with
325
+ `rebuild` and `refresh: upstream_promoted`. Do not add a whole table source to the log itself:
326
+ a refresh would have to read it whole, so it blocks the log's refresh (`SOURCE_READS_WHOLE`),
327
+ and the `rebuild` that would answer it is refused beside the snapshot.
328
+
329
+ `mr-data table show TABLE_ID` states how many days the log holds and how many remain before its
330
+ ceilings, from the server's forecast. Size `window.snapshot.max_partitions` and
331
+ `limits.max_source_bytes` for the whole horizon before you register: both are fixed once the
332
+ recipe is registered.
333
+
275
334
  ### A predict table over fixed inputs
276
335
 
277
336
  When no input will change again, such as a file read once or an upstream table that never
@@ -508,10 +567,11 @@ A person can ask for the predictions in the same table as their data. Build it t
508
567
  predictions: the receipt's `predict` member shows `attempts` 0 and `rows.sent` 0, and no call is
509
568
  spent. The table then holds no prediction until a row appears ahead. Check that the upstream
510
569
  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
514
- and ask; never overwrite past predictions without telling them. A rebuild from unchanged inputs
570
+ - **Say that predictions change.** Every rebuild replaces every prediction, so a past row's
571
+ value can change when the model sees more data, and the table keeps no record of what it said
572
+ before. Say so in the description. To keep what was predicted at the time, build a
573
+ prediction log ([keep what each prediction said](#keep-what-each-prediction-said)). Tell the
574
+ person and ask; never overwrite past predictions without telling them. A rebuild from unchanged inputs
515
575
  gives the same values to a relative 1e-5 (1e-6 near zero), not the same bytes, so an unchanged request can still
516
576
  seal a new version.
517
577
 
@@ -562,7 +622,7 @@ still counts in `usage_today.calls` in `mr-data models --json`.
562
622
  | Code | What to do |
563
623
  | --- | --- |
564
624
  | `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. |
625
+ | `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
626
  | `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
627
  | `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
628
  | `PREDICT_RESPONSE_INVALID` | The answer had the wrong shape. Run again once, then report it. |
@@ -594,7 +654,9 @@ Tick each one, and report any you skipped with the reason:
594
654
  - [ ] A query shows the earliest predicted row is after the latest training row, or, with no
595
655
  time order, that no row key is in both sets.
596
656
  - [ ] 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:
657
+ predict source in the workspace, and `promote --why` states the arithmetic.
658
+ `max_rebuild_bytes` is at least the sum of every source's `limits.max_source_bytes`, and
659
+ `mr-data table show` names no budget hold. Over fixed inputs:
598
660
  no `refresh`, no schedule, and a "Fixed snapshot: no refresh" note that names the table.
599
661
  - [ ] A refreshing table holds rows ahead at every rebuild, or the person knows when it has none.
600
662
  - [ ] 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",
@@ -545,3 +545,74 @@ Three rules cost a round trip when they are missed:
545
545
 
546
546
  The full member list is in `docs/RECIPE-DOCUMENT.md`, "Needs server 4.38".
547
547
 
548
+ ### Keeping a daily history of another table
549
+
550
+ A table built from table sources is rebuilt from them, so it cannot keep a row its upstream
551
+ dropped or replaced. Server 4.70 can capture the upstream once a day instead.
552
+
553
+ #### Needs server 4.70
554
+
555
+ Check first: run `mr-data recipe explain RECIPE.json --json` and read `table_source_snapshot` and `snapshot_refresh` in `studio_capabilities`. When `table_source_snapshot` is false, `mr-data recipe` refuses the recipe before registering it ("not available on this server yet"): tell the person the server does not keep such a history yet, and register nothing. When `snapshot_refresh` is false, the recipe registers with `SNAPSHOT_WILL_NOT_REFRESH_YET`, and each build keeps the one day it read: tell the person no history builds up until the server turns snapshot refresh on.
556
+
557
+ The source reads the upstream's latest promoted version, keeps the rows its
558
+ `row_filter` admits, stamps them with the UTC day it read them, and merges that day onto the
559
+ table's history:
560
+
561
+ ```json
562
+ {
563
+ "name": "captures",
564
+ "source_class": "mostlyright_table",
565
+ "data_classification": "public",
566
+ "locator": {
567
+ "kind": "table",
568
+ "display_locator": "table:UPSTREAM_TABLE_ID@latest_promoted",
569
+ "table": {"table_id": "UPSTREAM_TABLE_ID", "version": "latest_promoted"}
570
+ },
571
+ "rights_claim": {"claimed_basis": "permission_asserted", "claim_evidence_digest": "sha256:EVIDENCE_SHA256",
572
+ "claim_note": "A table this workspace built and promoted."},
573
+ "connector": {
574
+ "adapter_id": "table.version@1.0.0",
575
+ "credential_mode": "none",
576
+ "parameters": [
577
+ {"name": "reader.family_id", "value": "parquet.tabular"},
578
+ {"name": "reader.family_version", "value": "1.0.0"},
579
+ {"name": "reader.decode_options", "value": "{}"}
580
+ ]
581
+ },
582
+ "limits": {"max_source_bytes": 536870912, "max_requests": 1},
583
+ "row_filter": "row_kind = 'predicted'",
584
+ "window": {
585
+ "start_at": "2026-11-20T00:00:00Z",
586
+ "granularity": "day",
587
+ "timezone": "UTC",
588
+ "lookback_seconds": 0,
589
+ "max_span_seconds": 86400,
590
+ "snapshot": {"column": "captured_on", "max_partitions": 1200},
591
+ "merge": {
592
+ "materialization": "partition_replace",
593
+ "partition": {"column": "captured_on", "key": "iso_date_value"},
594
+ "row_identity": ["captured_on", "balancing_authority", "hour_utc"]
595
+ }
596
+ }
597
+ }
598
+ ```
599
+
600
+ - The window is a daily `window.snapshot` and nothing else: `granularity: day`,
601
+ `lookback_seconds: 0`, `max_span_seconds: 86400`, and a merge partitioned on the snapshot column
602
+ with key `iso_date_value`. `row_identity` names the snapshot column and the columns that make a
603
+ captured row unique. A request window or an hourly snapshot is refused on a table source.
604
+ - `row_filter` is optional: one DuckDB boolean expression over the upstream's columns, each read
605
+ as text. Leave it out to keep every row. An unknown column fails the run `ROW_FILTER_INVALID`
606
+ before any part of the upstream is read, and a capture that keeps no row fails `SNAPSHOT_RELATION_EMPTY` and
607
+ erases nothing.
608
+ - `limits.max_source_bytes` bounds what the table keeps, not what it reads: each day's filtered
609
+ rows and, up to 4 GiB, the whole history. The read of the upstream is held to 4 GiB. Size it at
610
+ the bytes one day keeps times the days to keep, with headroom, and `max_partitions` at the days
611
+ to keep. Both are fixed once the recipe is registered.
612
+ - Declare `refresh: {trigger: upstream_promoted, debounce_seconds: 900}` and no `rebuild`: a
613
+ rebuild beside a snapshot is refused, since it would replace every day held with one. Each
614
+ promotion starts a refresh that appends the day. The server captures at most once a UTC day, and
615
+ a later capture of the same day replaces it. Promote with `--cadence "every 1d"` so a day is
616
+ captured even when the upstream does not promote.
617
+ - Keep the capture table to this one source. A whole table source beside it blocks every refresh
618
+ (`SOURCE_READS_WHOLE`). Join or score the history in another table that reads this one.
@@ -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"),
@@ -1449,7 +1449,8 @@ def register(
1449
1449
  """``mr-data recipe FILE``: register one document and print what the server derived from it.
1450
1450
 
1451
1451
  Existing documents are linted before a credential is resolved. A document using keyless
1452
- grammar (``keyless_window`` or ``keyless_post``) asks what Studio serves before local lint,
1452
+ grammar (``keyless_window`` or ``keyless_post``) or a snapshot table source
1453
+ (``table_source_snapshot``) asks what Studio serves before local lint,
1453
1454
  because an older schema may reject the grammar before reporting capabilities. The brief and
1454
1455
  delegation gates follow, and registration is last.
1455
1456
  """
@@ -1460,7 +1461,7 @@ def register(
1460
1461
  v4.recipe_registration_body(document, "00000000-0000-0000-0000-000000000000")
1461
1462
  # New grammar must be refused as unserved before local lint can diagnose its shape.
1462
1463
  keyless = any(
1463
- capability in recipe_explain.KEYLESS_CAPABILITIES
1464
+ capability in recipe_explain.SCHEMA_GATED_CAPABILITIES
1464
1465
  for _, capability in recipe_explain.gated_grammar(document)
1465
1466
  )
1466
1467
  selected = client
@@ -1498,6 +1499,9 @@ def register(
1498
1499
  len(declared_sources) if isinstance(declared_sources, list) else 0,
1499
1500
  rebuild_declared=recipe_explain.declared_rebuild(document) is not None,
1500
1501
  )
1502
+ # A budget under the declared ceilings registers, and the server holds each scheduled rebuild.
1503
+ held = recipe_explain.rebuild_budget_warning(document)
1504
+ warnings += [held] if held is not None else []
1501
1505
  # THE SECOND GATE, in the same place as the first. A recipe that passed the first one can
1502
1506
  # still hold a plan Studio refuses outright, and an author who repaired the first warning by
1503
1507
  # declaring `closed` everywhere would otherwise be answered with silence.