mostlyright-data 0.31.30__tar.gz → 0.31.31__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.30 → mostlyright_data-0.31.31}/PKG-INFO +1 -1
  2. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/SKILL.md +18 -6
  3. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/commands.md +1 -1
  4. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/enriching-with-small-models.md +4 -3
  5. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/narrating-the-run.md +1 -1
  6. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/predicting-with-tabular-models.md +248 -66
  7. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/promote.md +13 -1
  8. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/sources.md +2 -1
  9. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/enrichment.py +39 -7
  10. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/recipe_lint.py +128 -12
  11. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/table_search_contract.json +1 -1
  12. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4.py +2 -2
  13. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_datasets.py +3 -0
  14. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_narrative.py +3 -0
  15. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_runs.py +85 -10
  16. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/.gitignore +0 -0
  17. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/README.md +0 -0
  18. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/pyproject.toml +0 -0
  19. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/scripts/hatch_build.py +0 -0
  20. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/agents/openai.yaml +0 -0
  21. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/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.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/2-brief-two-to-four-questions-each-with-a-recommended-answer.md +0 -0
  23. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/3-probe-read-a-source-before-committing-to-it.md +0 -0
  24. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/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.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/5-draft-one-recipe-document-one-call.md +0 -0
  26. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/6-build-one-run-sized-to-acquire-every-measured-source-whole.md +0 -0
  27. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/7-interrogate-ask-the-run-what-it-actually-delivered.md +0 -0
  28. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/8-fix-revise-the-document-and-register-it-again.md +0 -0
  29. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/9-present-only-what-survived-inspection-with-caveats.md +0 -0
  30. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/agent-protocol.md +0 -0
  31. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/autonomous-delivery.md +0 -0
  32. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/before-the-first-tool-call.md +0 -0
  33. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/boundaries.md +0 -0
  34. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/cloud-authentication-preflight.md +0 -0
  35. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/live-run.md +0 -0
  36. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/making-a-table-incremental.md +0 -0
  37. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/not-hosted-yet.md +0 -0
  38. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/one-install.md +0 -0
  39. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/patterns.md +0 -0
  40. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/prediction-labels.md +0 -0
  41. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/preparing-table-search.md +0 -0
  42. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/readers.md +0 -0
  43. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/receipts.md +0 -0
  44. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/recipe-test.md +0 -0
  45. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/recording-a-stream-venue.md +0 -0
  46. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/recovering-an-import-failure.md +0 -0
  47. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/reference-pages.md +0 -0
  48. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/required-protocol.md +0 -0
  49. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/satellite-signals.md +0 -0
  50. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/source-credentials.md +0 -0
  51. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/the-one-thing-to-say-about-the-skill-itself.md +0 -0
  52. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/transforms.md +0 -0
  53. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/user-communication-contract.md +0 -0
  54. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/references/writing-a-decision-record.md +0 -0
  55. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/skills/mr-data-build/scripts/write_research_notebook.py +0 -0
  56. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/__init__.py +0 -0
  57. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/agent_protocol.py +0 -0
  58. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/canonical.py +0 -0
  59. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/key_seam.py +0 -0
  60. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/page_coverage.py +0 -0
  61. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/part_check_evidence.py +0 -0
  62. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/session_probes.py +0 -0
  63. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/skill_assets.py +0 -0
  64. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/table_manifest.py +0 -0
  65. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/__init__.py +0 -0
  66. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/activity.py +0 -0
  67. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/backoff.py +0 -0
  68. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/categories.py +0 -0
  69. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/dataset-categories-v1.json +0 -0
  70. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/dataset_layout.py +0 -0
  71. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/delivery.py +0 -0
  72. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/description_shape.py +0 -0
  73. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/download.py +0 -0
  74. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/fast_features.py +0 -0
  75. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/matching_benchmark.py +0 -0
  76. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/probe.py +0 -0
  77. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/progress_rate.py +0 -0
  78. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/progress_vocabulary.py +0 -0
  79. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/recipe.py +0 -0
  80. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/recipe_brief.py +0 -0
  81. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/recipe_explain.py +0 -0
  82. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/recipe_forecast.py +0 -0
  83. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/recipe_test.py +0 -0
  84. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/refresh_rehearsal.py +0 -0
  85. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/release_check.py +0 -0
  86. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/research.py +0 -0
  87. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/router.py +0 -0
  88. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/run_diagnose.py +0 -0
  89. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/run_prefix.py +0 -0
  90. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/runs.py +0 -0
  91. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/session.py +0 -0
  92. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/stream.py +0 -0
  93. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/stream_venue.py +0 -0
  94. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/studio_capabilities.py +0 -0
  95. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/support.py +0 -0
  96. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/table_view.py +0 -0
  97. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/transport.py +0 -0
  98. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/user_agent.py +0 -0
  99. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_artifacts.py +0 -0
  100. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_catalog.py +0 -0
  101. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_connected.py +0 -0
  102. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_connections.py +0 -0
  103. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_dataset_covers.py +0 -0
  104. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_handoff.py +0 -0
  105. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_matching.py +0 -0
  106. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_public.py +0 -0
  107. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_query.py +0 -0
  108. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_reader.py +0 -0
  109. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_search.py +0 -0
  110. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_search_contract.py +0 -0
  111. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_secrets.py +0 -0
  112. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_stream.py +0 -0
  113. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/v4_tables.py +0 -0
  114. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/thin/vocabulary.py +0 -0
  115. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/__init__.py +0 -0
  116. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/attendance.py +0 -0
  117. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/clarification.py +0 -0
  118. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/cloud_auth.py +0 -0
  119. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/commands/__init__.py +0 -0
  120. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/commands/auth.py +0 -0
  121. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/commands/clarify.py +0 -0
  122. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/commands/login.py +0 -0
  123. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/commands/whoami.py +0 -0
  124. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/credential_native.py +0 -0
  125. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/credential_store.py +0 -0
  126. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/credentials.py +0 -0
  127. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/login.py +0 -0
  128. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/path_kind.py +0 -0
  129. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/plain_file.py +0 -0
  130. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/src/mostlyright/data_harness/ux/remediation.py +0 -0
  131. {mostlyright_data-0.31.30 → mostlyright_data-0.31.31}/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.30
3
+ Version: 0.31.31
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/
@@ -166,7 +166,10 @@ step 6. The stage 3 reference holds its rule. Gate 4 is step 6.
166
166
  Register a live predict table only after a backtest table has compared it with a baseline
167
167
  ([predicting with tabular models](references/predicting-with-tabular-models.md)).
168
168
  Put the predictions in the table people read, in their own `predicted_<target>` columns beside
169
- the measured column, never in it, so the measured values stay as they were measured.
169
+ the measured column, never in it, so the measured values stay as they were measured. When the
170
+ features need a join, a derived column or a flag, make them in the predict source's `prepare`
171
+ over sibling sources of that same recipe. Build a supporting upstream table only when
172
+ `prepare` cannot: over its limits, or a preparation other tables also need.
170
173
  Bind `dataset.id`, describe columns, declare checks and units, and register with
171
174
  `mr-data recipe RECIPE.json --json`. Repair all lint findings before queuing work.
172
175
  The server returns the recipe digest; do not compute or invent it.
@@ -280,7 +283,11 @@ with failed pages is still incomplete coverage.
280
283
 
281
284
  Legacy `room_fault: true` can identify a supported `mr-data run --retry RUN_ID` case. A failed
282
285
  or cancelled progressive full is resumed by the same command from the pages it saved, unless the
283
- failure says the recipe must change.
286
+ failure says the recipe must change. After Mostly Right fixes a fault of its own, rebuild with
287
+ `mr-data run --retry RUN_ID` on the newest failed run of that recipe. A predict run that failed
288
+ `ARTIFACT_PERSIST_FAILED` also takes `--repaired`, since the retry spends one more call. A plain
289
+ `mr-data run --recipe RECIPE_ID --digest DIGEST --full` with unchanged coordinates returns the
290
+ stored failure and queues nothing; its `next_command` names the newest failed run.
284
291
  **`room_fault: false` does not prove the recipe is wrong.** Repeating a terminal coordinate may
285
292
  only return its stored failure. Retry at most three times when supported by evidence, then report
286
293
  what remains unresolved. Never narrow coverage, drop checks, guess encodings or switch sources
@@ -319,9 +326,11 @@ chat, and pass on its answer.
319
326
  saved view, a refresh cadence when none is recorded, and always the enrichment offer.
320
327
  Complete every step before you report the build as done. The server marks no main table, so you
321
328
  judge it: skip the search and view steps for a supporting table and say so in one line. A
322
- scratch table you test, demote and archive owes none of these steps. A table that prepares
323
- features for a prediction is a supporting table; the table holding the predictions is the main
324
- table, since people read the predictions beside their data. A predict backtest table is kept as
329
+ scratch table you test, demote and archive owes none of these steps. The table holding the
330
+ predictions is the main table, since people read the predictions beside their data. Its
331
+ `prepare` makes the features, so it needs no supporting table; one built because `prepare`
332
+ cannot do the work is a supporting table. A predict table whose inputs never change is a fixed
333
+ snapshot: no `refresh`, no cadence, and a note instead. A predict backtest table is kept as
325
334
  a named comparison table with its own description, or demoted and archived; tick the predict
326
335
  page's [end-of-build list](references/predicting-with-tabular-models.md#before-you-say-the-predict-table-is-done).
327
336
  The block also names every
@@ -345,7 +354,10 @@ chat, and pass on its answer.
345
354
  Record the cadence under step 9's readiness rule. A fixed snapshot has no cadence to record:
346
355
  write that decision as a dataset note and skip the step, saying so in one line. A note that
347
356
  names tables, each in backticks, covers only those, so a refreshing dataset can record its
348
- static archive or lookup tables without claiming the whole dataset is a snapshot.
357
+ static archive or lookup tables without claiming the whole dataset is a snapshot. To change a
358
+ note, write it again with its `--cell-id` from `dataset note DATASET_ID --list`. Leaving out
359
+ `--cell-id` derives it from the heading, so a reused heading replaces that cell and a new one
360
+ starts another.
349
361
  Offering enrichment is mandatory. Accepting it is the person's choice, and a no is a complete
350
362
  answer.
351
363
  9. Any truncated source means a preview, not the requested complete dataset. Inspect coverage
@@ -25,7 +25,7 @@ run in full.
25
25
  | `mr-data dataset` | Bring the dataset page into existence before there is anything on it, then fill it in while somebody watches. `dataset create --name TEXT` mints it and prints the `dataset_id`, unless the user's own request already has an empty dataset open, in which case it answers `open_request_reused` with that `dataset_id` and mints nothing (`--separate` mints a new one for a different dataset); `dataset show ID` reads it back; `dataset check ID` lists every delivery step the whole dataset still owes (cover, description shape, topics (never a licence), a real table that is unbuilt, queued, building, held or live on a build cut short, search and a saved view on the main table (the layout's `search_table_id` and `default_table_id` when it names them), cadence, failing refreshes, every `scratch_` table still listed), exits 2 and ends `Delivery open: N items.` while any is open, and exits 0 with `Delivery complete.` when none is (with `--json`, `status` is `dataset_delivery_open` or `dataset_delivery_complete`); `dataset set ID --name TEXT --topics "a,b,c" --license ID --description-file F` writes the title, the descriptive tags, the SPDX licence and the description under the version it was read at, retrying once if somebody else wrote first, and an empty `--topics` or `--license` takes that value off the page; send `--name` and `--topics` whenever you send `--description-file`, because a description sent on its own can make the server write a new title and new tags, and read `changed` and `written_by_studio` on the receipt for every field the write moved; a saved write whose public sync fails exits 2 and reports `public_projection_synced: false` — use `dataset sync ID` to retry that sync without writing the dataset again; `dataset note ID --heading H --blocks-file B` writes one cell of the decision record that OUTLIVES every run, and `--list` reads it back; `dataset watch ID` follows the page's own event stream; `dataset activity ID --phase P --message TEXT` says what is happening right now, silently, and is never a chat message and never a cell; `dataset publish ID [--mode public|link|private]` says who can read the dataset — `public` lists it in the public directory and serves it at an address anybody can read, `link` serves it at an unlisted address, `private` takes it back to the workspace — and `dataset publish ID --show` reads that back without changing it; `dataset layout ID` reads the dataset's layout from Cloud: its sections, `default_table_id` (the table the Data tab opens on), `search_table_id` (the table the dataset's search runs on), the main-table choice and the dataset's tables; `dataset layout ID --set LAYOUT.json` saves `{"version": 1, "default_table_id", "search_table_id", "sections": [{"id", "title", "collapsed", "tables": [{"table_id", "title", "description"}]}]}`, `--dry-run` has Cloud check it and save nothing, replacing a saved layout needs its revision as `--expected-revision`, and a first layout takes `--expected-main-table TABLE_ID|none`, the main-table choice the read printed; a stale one is refused `THIN_DATASET_LAYOUT_LAYOUT_CHANGED`, and it uses the device key; `dataset archive ID --confirm-name TITLE` retires the page and frees its title, deleting nothing. |
26
26
  | `mr-data recipe` | Register one recipe document (dataset, question, table plan, sources, transform, checks and units) in one call, and print the identifiers the server derived. The document is read first and every fault comes back in one refusal, each with the JSON pointer that names it. `--no-lint` sends it as written instead. A recipe that misses a feature that sets how fast a run fetches (a stated `pages.concurrency` under 64, a per-row request open to `batch`, a page walk open to `pagination.parallel`, or a Parquet file open to a ranged read) is refused `THIN_RECIPE_SLOW`, with each feature's pointer and fix, before anything is sent. Apply the fixes, or pass `--accept-slow "REASON"` with one sentence on why the slow path is right for this source. The receipt prints the reason and the features it covered. Registration refuses `THIN_BRIEF_MISSING` when the dataset's record carries no answered question and no delegation, and `THIN_RECIPE_DATASET_UNBOUND` when the document names no `dataset.id`. `--delegated "their words"` writes the delegation onto the dataset and registers in the same command, and clears the first of those two and never the second. `mr-data recipe show ID` reads one back. `mr-data recipe explain FILE` (or a recipe identifier) lists every reason its table can or cannot refresh, each with a rule code and the server's suggested repair, and exits 2 when one blocks it. `mr-data recipe forecast RECIPE_ID` says what one run would ask of each source before it runs, and exits 3 when the run would overrun today's platform quota or one attempt. `--digest` is optional there, and without it the digest the recipe was registered with is forecast. `mr-data recipe readiness --table TABLE_ID --current-only` reads the revision one table runs now. The explanation's `fast_features` names each fast feature the recipe uses or misses, with a one-line fix. [Making a table incremental](making-a-table-incremental.md#the-loop-explain-forecast-run-diagnose) says when to use each. |
27
27
  | `mr-data cover` | Generate and attach one branded 1200×630 dataset cover. Give it the dataset ID and what the image should depict; the server fixes the model, single-color style, curated random palette, dimensions and storage. |
28
- | `mr-data run` | Start one run against a registered recipe, named as `--recipe RECIPE_ID`, with `--digest RECIPE_DIGEST` when you want the run to assert which bytes it means. Neither is positional. The digest is the bare hex the registration receipt printed. Left out, the run reads it back from the registered recipe, which is the same value, because a recipe identifier names one revision. A full of a recipe that misses a fetch-speed feature is refused `THIN_RECIPE_SLOW`, as registration is, unless `--accept-slow "REASON"` is passed. Other modes print the missed features and are not refused. The mode is one of six: `sample`, `full`, `refresh`, `backfill`, `compact` and `replay`. Four have a shorthand flag (`--sample`, `--full`, `--refresh`, `--backfill`) and two do not, so write `--mode MODE`, which is accepted for every one of them. A refresh executes only the server's persisted source-action plan, and a plan shape it does not refresh returns `RESYNC_REQUIRED` before acquisition. [Which plans refresh](making-a-table-incremental.md#which-plans-refresh) lists them, and `mr-data recipe explain` says which one a table is. Use `mr-data table resync TABLE_ID --request-id UUID` for an explicit full source reread, retaining that UUID if the response is uncertain. `--backfill` states the exact window with `--window START END`. `--mode replay --sources-from RUN_ID` asks the server to run the registered revision against the RETAINED RAW INPUTS of one named successful run of the same table: nothing is fetched from this computer, nothing is acquired again, the result is compared against that run and never becomes the live version, and it neither asks for nor records an approval. Where the server has replay switched off, or the named run is not successful, not the same table, or no longer retains its inputs, it answers a typed refusal. Report the code rather than retrying in another mode. `--sources-from` on any other mode is refused `THIN_ARGUMENT_INVALID` before anything is sent. `--max-rows` and `--max-source-bytes` bound ONE SOURCE rather than the finished table. `--max-rows` cuts rows after a source is fetched and decoded, so it does not shorten a collection walk. A sample with no clamp is refused: `CLAMPS_REQUIRED` from the server, and `THIN_REQUEST_INVALID` from this client first. A table's first succeeded run goes live, truncated or not, so test on a scratch 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. A large run is held for a size confirmation (not a charge), which `--confirm` settles and whose printed `confirm_command` re-states every argument the request carried. `--approve-full RUN_ID` releases the full an existing legacy sample-first pair is holding once its preview has succeeded, naming either half of the pair. Where the deployment still wants a person at a browser it answers `THIN_INTERACTIVE_HUMAN_REQUIRED` and names the run page. `--retry RUN_ID` resumes a failed or cancelled progressive full from the pages it saved (`resume_capture_run_id` and the ceilings it carried; `retry_of_run_id` as well only when the server admits a named retry). A failure that says the recipe must change is refused before anything is posted. Any other failed run is tried again when its triple carries `room_fault: true`, re-stating that run's own coordinate and ceilings and naming the failed run so the server starts a new attempt, and is refused with the triple and the next step the server's recovery category names when it is not. `room_fault` is the server's `recovery.room_fault` where the server states one. A source that kept refusing (`SOURCE_RATE_LIMITED`, `SOURCE_HTTP_5XX`, `SOURCE_PROXY_BUSY`) is sent anyway: the server admits it 120 seconds after the failure and refuses `RUN_RETRY_TOO_SOON` with a Retry-After before then, so wait that long and run `--retry` again. `--cancel RUN` stops one. |
28
+ | `mr-data run` | Start one run against a registered recipe, named as `--recipe RECIPE_ID`, with `--digest RECIPE_DIGEST` when you want the run to assert which bytes it means. Neither is positional. The digest is the bare hex the registration receipt printed. Left out, the run reads it back from the registered recipe, which is the same value, because a recipe identifier names one revision. A full of a recipe that misses a fetch-speed feature is refused `THIN_RECIPE_SLOW`, as registration is, unless `--accept-slow "REASON"` is passed. Other modes print the missed features and are not refused. The mode is one of six: `sample`, `full`, `refresh`, `backfill`, `compact` and `replay`. Four have a shorthand flag (`--sample`, `--full`, `--refresh`, `--backfill`) and two do not, so write `--mode MODE`, which is accepted for every one of them. A refresh executes only the server's persisted source-action plan, and a plan shape it does not refresh returns `RESYNC_REQUIRED` before acquisition. [Which plans refresh](making-a-table-incremental.md#which-plans-refresh) lists them, and `mr-data recipe explain` says which one a table is. Use `mr-data table resync TABLE_ID --request-id UUID` for an explicit full source reread, retaining that UUID if the response is uncertain. `--backfill` states the exact window with `--window START END`. `--mode replay --sources-from RUN_ID` asks the server to run the registered revision against the RETAINED RAW INPUTS of one named successful run of the same table: nothing is fetched from this computer, nothing is acquired again, the result is compared against that run and never becomes the live version, and it neither asks for nor records an approval. Where the server has replay switched off, or the named run is not successful, not the same table, or no longer retains its inputs, it answers a typed refusal. Report the code rather than retrying in another mode. `--sources-from` on any other mode is refused `THIN_ARGUMENT_INVALID` before anything is sent. `--max-rows` and `--max-source-bytes` bound ONE SOURCE rather than the finished table. `--max-rows` cuts rows after a source is fetched and decoded, so it does not shorten a collection walk. A sample with no clamp is refused: `CLAMPS_REQUIRED` from the server, and `THIN_REQUEST_INVALID` from this client first. A table's first succeeded run goes live, truncated or not, so test on a scratch 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. A large run is held for a size confirmation (not a charge), which `--confirm` settles and whose printed `confirm_command` re-states every argument the request carried. `--approve-full RUN_ID` releases the full an existing legacy sample-first pair is holding once its preview has succeeded, naming either half of the pair. Where the deployment still wants a person at a browser it answers `THIN_INTERACTIVE_HUMAN_REQUIRED` and names the run page. `--retry RUN_ID` resumes a failed or cancelled progressive full from the pages it saved (`resume_capture_run_id` and the ceilings it carried; `retry_of_run_id` as well only when the server admits a named retry). A failure that says the recipe must change is refused before anything is posted. Any other failed run is tried again when its triple carries `room_fault: true`, re-stating that run's own coordinate and ceilings and naming the failed run so the server starts a new attempt, and is refused with the triple and the next step the server's recovery category names when it is not. `room_fault` is the server's `recovery.room_fault` where the server states one. A source that kept refusing (`SOURCE_RATE_LIMITED`, `SOURCE_HTTP_5XX`, `SOURCE_PROXY_BUSY`) is sent anyway: the server admits it 120 seconds after the failure and refuses `RUN_RETRY_TOO_SOON` with a Retry-After before then, so wait that long and run `--retry` again. A predict run that failed `ARTIFACT_PERSIST_FAILED` is refused, since a retry spends another call. Once Mostly Right says it is repaired and the person agrees, `--retry RUN_ID --repaired` retries it. A start whose coordinates match a failed run returns that stored failure; `next_command` and `latest_failed_run_id` name the newest failed run of the same recipe and digest. `--cancel RUN` stops one. |
29
29
  | `mr-data status` | Report which of the seven states one run is in, what it delivered and whether a ceiling cut it short, and — on a failure — what failed, where, and whether the fault was the execution room's rather than the recipe's. Exits non-zero on a failed run. `--diagnose` adds everything else the server can say about the run: its progress, a per-row source's plan counts, its checkpoints, and how each attempt ended, with a lost attempt's cause marked as an inference. A succeeded full run carries `delivery`: the steps still owed before the build is done (a description missing or out of the skill's shape, a missing cover, natural-language search when the dataset's main table has none, a view review when the table has no saved view, a refresh cadence when none is recorded, and always the enrichment offer), each with its command. A read that fails adds a note, never a step. It never changes the exit code. |
30
30
  | `mr-data runs` | Report this workspace's own runs: identifier, mode, state and creation time, plus the failure triple of any that failed and whether that failure was the execution room's. `--dataset DATASET_ID` narrows it to one dataset's runs, so "what have I run for this dataset?" is one scoped read, and a value that is not an identifier is refused `THIN_ARGUMENT_INVALID`. `--status` and `--mode` narrow it too and are refused `THIN_ARGUMENT_INVALID` for a word outside the seven states or the six modes; the three combine. The server narrows before it cuts a page, so a filtered page holds the newest runs that match however many runs the workspace has. `--limit` says how many, and pages are followed to reach it; a listing that does not end says how many were read and suggests a smaller `--limit` or a narrower filter. The answer prints `next_cursor`, and `--cursor` continues from it. |
31
31
  | `mr-data watch` | Stream one run's live progress under the durable event type of each stage, resuming across stream cuts. Exits non-zero when the run failed. `mr-data watch RUN_ID RUN_ID ...` follows up to 16 runs at once, prints one line as each ends, and returns once all have finished with one receipt per run (`failed_run_ids`, `refused_run_ids`); it exits 2 when any run failed and 1 when a run could not be watched. `--from-seq` and `--last-event-id` resume one run only. A full run that succeeds carries the same `delivery` block as `mr-data status`, and the multi-run receipt merges every run's steps. |
@@ -201,9 +201,10 @@ worked recipe, the refusal codes and what never to promise.
201
201
 
202
202
  ### Writing a predict source
203
203
 
204
- A predict source is not a per-row request. It reads a sibling table source and sends one request
205
- per rebuild: the labelled rows to learn from and the rows to predict. The listing's
206
- `request_template` for `predict` is a whole source to start from, and the binding's
204
+ A predict source is not a per-row request. It reads one sibling, or prepares its rows from
205
+ several with one SELECT, and sends one request per rebuild: the labelled rows to learn from and
206
+ the rows to predict. The listing's `request_template` for `predict` is a whole source that reads
207
+ one sibling, and its `prepare_template` one that prepares its rows. The binding's
207
208
  `predict_limits` bound its row counts. Back-test it against a naive baseline before you offer the
208
209
  result, and never promise accuracy.
209
210
  [Predicting with tabular models](predicting-with-tabular-models.md) has the steps, the honest
@@ -103,7 +103,7 @@ cleaning choices that change the meaning are theirs, and go in a block.
103
103
  explains. Writing the same `--heading` again revises that cell in place and the earlier version
104
104
  stays in the record; use `--cell-id` where the heading itself changes with the conclusion, and
105
105
  `--revise CELL_ID` where the successor is a differently named cell. A cell revises itself by
106
- reusing its own identifier, so `--revise` naming the cell you are writing is refused.
106
+ reusing its own identifier, so `--revise` naming the cell you are writing revises it in place.
107
107
 
108
108
  `mr-data note --run RUN_ID --list --json` and `mr-data dataset note DATASET_ID --list --json` read
109
109
  back what is written, superseded revisions included and flagged. Each reads and writes nothing, so
@@ -11,7 +11,9 @@ Run `mr-data models --json` once per session. Read the task `predict`:
11
11
 
12
12
  - `available`: its binding (usually named `predict`) carries `origin`, the pinned `model`
13
13
  (`jingang/tabicl-v2-...`), `predict_limits`, `quota`, `usage_today`, `calls_left_today` and a
14
- `request_template`. The template is a predict source to start from. Add its `name`,
14
+ `request_template` and a `prepare_template`. Each is a predict source to start from. The
15
+ `request_template` reads one sibling. The `prepare_template` prepares its rows from two
16
+ ([prepare the rows in the recipe](#prepare-the-rows-in-the-recipe)). Add its `name`,
15
17
  `description`, `data_classification` and `rights_claim` as for any source. The predictions
16
18
  are Mostly Right's model output over the person's own table. State `claimed_basis`
17
19
  `permission_asserted`, the `claim_evidence_digest` of the table source it reads, and a
@@ -58,17 +60,27 @@ to a model Mostly Right runs in its own cloud project, and to no vendor.
58
60
 
59
61
  ### Build it
60
62
 
61
- 1. Put the predict source in the table people read, beside the source it reads. That source
62
- holds one row per prediction unit, the features, and the target, empty where unknown. A feature
63
- must be what was known at prediction time. For weather, use the forecast as issued at the lead
64
- time you predict for, never the analysis or the observation.
65
- 2. When the features need preparing first (a join or a derived column), build that preparation as
66
- its own upstream table, and read it with a table source in the main table. Add one predict
67
- source per target and a transform that joins the predictions back
63
+ 1. Put the predict source in the table people read, beside the sources it reads. It states
64
+ exactly one of two members:
65
+ - `prepare`, the default whenever the features need preparing. One SELECT over 1 to 8
66
+ siblings in the same recipe makes the rows: a join, a derived column, or a flag such as
67
+ `is_ahead`. Start from the `prepare_template` and follow
68
+ [prepare the rows in the recipe](#prepare-the-rows-in-the-recipe).
69
+ - `source`, when one sibling already holds the rows as they are sent. Start from the
70
+ `request_template`.
71
+
72
+ The rows hold one row per prediction unit, the features, and the target, empty where unknown.
73
+ A feature must be what was known at prediction time. For weather, use the forecast as issued
74
+ at the lead time you predict for, never the analysis or the observation.
75
+ 2. Build a supporting upstream table only when `prepare` cannot do the preparation: it is over
76
+ prepare's limits, or other tables need the same prepared rows. Read that table with a table
77
+ source and name it in `source`. Either way, add one predict source per target and a transform
78
+ that joins the predictions back
68
79
  ([put predictions in the table people read](#put-predictions-in-the-table-people-read)).
69
- 3. List every column the predict source reads in the table source's `reader.decode_options`, as
80
+ 3. List every column a sibling gives in that table source's `reader.decode_options`, as
70
81
  `{"columns": ["farm_id", "hour_utc", ...]}`. Decode options of `{}` read every column but
71
- declare none, and registration then refuses every column the predict source names.
82
+ declare none, and registration then refuses every column the predict source names. With
83
+ `prepare`, list every column the predict source names in `prepare.columns` as well.
72
84
  4. Set `task` to `regression` for a number or `classification` for a label. For a
73
85
  classification, delete the template's `output` member: only a regression takes quantiles.
74
86
  Name the target in `target.column` and each feature with `kind` `number` or `category`. A
@@ -88,19 +100,197 @@ to a model Mostly Right runs in its own cloud project, and to no vendor.
88
100
  8. `row_key` names one to four columns, unique among the rows to predict. Set `limits.max_requests`
89
101
  to at least one plus `retries`, and keep `retries` at 1 or more so a rebuild waits out a cold
90
102
  start.
91
- 9. Declare a table `rebuild`. When the predict source reads a table source, add
92
- `refresh: {trigger: upstream_promoted, debounce_seconds: 900}` beside `rebuild`, at the top
93
- of the recipe, so the predictions are recomputed when the upstream table promotes. Set `min_interval_seconds` from the allowance
103
+ 9. Decide whether the inputs change. When they never change, the predictions never change
104
+ either: build a fixed snapshot ([a predict table over fixed inputs](#a-predict-table-over-fixed-inputs)).
105
+ When a sibling table promotes new rows, declare a table `rebuild` and add
106
+ `refresh: {trigger: upstream_promoted, debounce_seconds: 900}` beside it, at the top of the
107
+ recipe, so the predictions are recomputed when an upstream table promotes. Set
108
+ `min_interval_seconds` from the allowance
94
109
  ([fit the daily allowance](#fit-the-daily-allowance)). Size `max_rebuild_bytes` to cover the
95
110
  sum of every source's `limits.max_source_bytes`; the first rebuild is projected from them.
96
111
 
97
- A sample makes one small request per predict source and counts against the allowance.
112
+ A sample makes one small request per predict source and counts against the allowance. The
113
+ recipe test does not run for a recipe with a predict source, so the first full run is its test.
114
+
115
+ `mr-data run` takes the recipe by flag, not by position:
116
+ `mr-data run --recipe RECIPE_ID --digest DIGEST --full`.
98
117
 
99
118
  Each output row has the `row_key` columns, `prediction`, and `model` (the served pin) and
100
119
  `trained_through` (the largest training `order_by` value sent). A regression adds `p10`, `p50` and
101
120
  `p90`, one column per entry of `output.quantiles_percent`. A classification adds `probability` and
102
121
  `class_probabilities` (JSON text). Every output column is text: cast in the transform.
103
122
 
123
+ ### Prepare the rows in the recipe
124
+
125
+ `prepare` makes the rows the model trains on and predicts, inside the recipe that holds the
126
+ predictions. So a join, a derived column or a flag lives in the one table people read, and no
127
+ supporting table is built for it. It has three members:
128
+
129
+ - `sources` names 1 to 8 siblings. None is a reference or a predict source, and each states
130
+ `limits.max_source_bytes` at most 268435456 (256 MiB), since the siblings are joined on local
131
+ disk.
132
+ - `sql` is one read-only DuckDB SELECT over those siblings, at most 65,536 characters. It follows
133
+ a transform step's rules: one statement, no file or network access, and no call such as
134
+ `now()` or `random()` whose value the data does not fix.
135
+ - `columns` lists its output columns in order, 1 to 256 of them. Every column the predict source
136
+ names, its filters included, is one of them.
137
+
138
+ Keep these rules:
139
+
140
+ - Every sibling cell reaches the statement as text, an empty cell as NULL. Cast to compute.
141
+ - Every prepared column is text again. A boolean arrives as `'true'` or `'false'`, so filter
142
+ `is_ahead = 'true'`, never `is_ahead` bare.
143
+ - The rows come out in one fixed order, ordered by every column. A window function orders by a
144
+ unique key, or its result can change between runs.
145
+ - Pass each `row_key` column through from a sibling unchanged. The transform joins the
146
+ predictions back on that text. A derived key would have to be spelled the same way there.
147
+ - The transform cannot read the prepared rows. It reads the siblings and the predictions, so it
148
+ repeats the join it needs.
149
+ - A preparation past 2,000,000 rows, past 1 GiB of text, or with a row past 8 MiB fails
150
+ `PREDICT_INPUT_EXCEEDS_LIMIT`.
151
+ - A sample reads a table sibling whole but can cut any other sibling. When the cut sibling joins
152
+ no training row, the sample fails `PREDICT_INPUT_EMPTY`, and the detail names the siblings it
153
+ cut. The full run reads them whole, so run the full build.
154
+
155
+ `mr-data recipe RECIPE.json` checks the members, the limits and the siblings before it sends
156
+ anything. Studio then binds the statement over the siblings and refuses a statement it can never
157
+ run, such as a second statement, a write, a relation outside `sources`, a column no sibling has,
158
+ or output columns other than `columns` in order.
159
+
160
+ #### Worked example: two siblings, one table
161
+
162
+ The person reads one table of hourly wind generation per farm. Two tables of their workspace
163
+ feed it. `farm_forecast` holds the forecast for each farm and hour: `farm_id`, `hour_utc`,
164
+ `lead_hours`, `wind_speed_100m_ms` and `wind_direction_100m_deg`. `farm_generation` holds what
165
+ each farm generated: `farm_id`, `hour_utc` and `generation_mw`. Each is an ordinary table source
166
+ ([sources](sources.md)) that lists those columns in its `reader.decode_options`.
167
+
168
+ The preparation joins them, makes a text key to order by, derives the hour of day, and flags
169
+ each hour after the latest measured hour as `is_ahead`:
170
+
171
+ ```sql
172
+ select f.farm_id, f.hour_utc,
173
+ strftime(cast(f.hour_utc as timestamptz) at time zone 'UTC', '%Y-%m-%dT%H:%M:%SZ') as hour_key,
174
+ f.lead_hours, f.wind_speed_100m_ms, f.wind_direction_100m_deg,
175
+ extract(hour from cast(f.hour_utc as timestamptz) at time zone 'UTC') as hour_of_day,
176
+ g.generation_mw,
177
+ cast(f.hour_utc as timestamptz) > (
178
+ select max(cast(m.hour_utc as timestamptz)) from farm_generation m
179
+ where m.generation_mw is not null) as is_ahead
180
+ from farm_forecast f
181
+ left join farm_generation g
182
+ on g.farm_id = f.farm_id and cast(g.hour_utc as timestamptz) = cast(f.hour_utc as timestamptz)
183
+ ```
184
+
185
+ `farm_id` and `hour_utc` pass through from `farm_forecast` unchanged, so they are the row key.
186
+ The forecast holds one row per farm and hour, so the key is unique. `hour_key` is spelled alike
187
+ on every row, so both row sets order by it. The predict source, completed from the
188
+ `prepare_template`, with the statement as one string:
189
+
190
+ ```json
191
+ {
192
+ "name": "generation_forecast",
193
+ "description": "Predicted hourly wind generation for each farm, from its forecast.",
194
+ "source_class": "model_prediction",
195
+ "data_classification": "internal",
196
+ "locator": {"kind": "model", "display_locator": "model:predict/MODEL"},
197
+ "rights_claim": {
198
+ "claimed_basis": "permission_asserted",
199
+ "claim_evidence_digest": "sha256:DIGEST_OF_THE_FORECAST_TABLE_SOURCE",
200
+ "claim_note": "Predictions from this workspace's own tables."
201
+ },
202
+ "connector": {
203
+ "adapter_id": "model.predict@1.0.0",
204
+ "credential_mode": "platform",
205
+ "parameters": [],
206
+ "origin": "ORIGIN"
207
+ },
208
+ "predict": {
209
+ "binding": "predict",
210
+ "model": "MODEL",
211
+ "task": "regression",
212
+ "prepare": {
213
+ "sources": ["farm_forecast", "farm_generation"],
214
+ "sql": "select f.farm_id, f.hour_utc, strftime(cast(f.hour_utc as timestamptz) at time zone 'UTC', '%Y-%m-%dT%H:%M:%SZ') as hour_key, f.lead_hours, f.wind_speed_100m_ms, f.wind_direction_100m_deg, extract(hour from cast(f.hour_utc as timestamptz) at time zone 'UTC') as hour_of_day, g.generation_mw, cast(f.hour_utc as timestamptz) > (select max(cast(m.hour_utc as timestamptz)) from farm_generation m where m.generation_mw is not null) as is_ahead from farm_forecast f left join farm_generation g on g.farm_id = f.farm_id and cast(g.hour_utc as timestamptz) = cast(f.hour_utc as timestamptz)",
215
+ "columns": ["farm_id", "hour_utc", "hour_key", "lead_hours", "wind_speed_100m_ms",
216
+ "wind_direction_100m_deg", "hour_of_day", "generation_mw", "is_ahead"]
217
+ },
218
+ "training": {
219
+ "row_filter": "generation_mw is not null and wind_speed_100m_ms is not null",
220
+ "order_by": "hour_key",
221
+ "max_rows": 8000
222
+ },
223
+ "rows": {
224
+ "row_filter": "is_ahead = 'true' and wind_speed_100m_ms is not null",
225
+ "order_by": "hour_key",
226
+ "max_rows": 500
227
+ },
228
+ "row_key": ["farm_id", "hour_utc"],
229
+ "target": {"column": "generation_mw"},
230
+ "features": [
231
+ {"column": "wind_speed_100m_ms", "kind": "number"},
232
+ {"column": "wind_direction_100m_deg", "kind": "number"},
233
+ {"column": "lead_hours", "kind": "number"},
234
+ {"column": "hour_of_day", "kind": "category"}
235
+ ],
236
+ "output": {"quantiles_percent": [10, 50, 90]},
237
+ "retries": 1
238
+ },
239
+ "limits": {"max_requests": 2, "max_rows": 500, "max_source_bytes": 67108864}
240
+ }
241
+ ```
242
+
243
+ Copy `MODEL` and `ORIGIN` from `mr-data models --json`. Training is every measured hour, and
244
+ the rows predicted are the hours after the latest one of any farm, so training ends before the
245
+ first predicted row. A farm whose measurements lag has hours that are neither measured nor
246
+ predicted; its `value_status` says `none` there. Flag per farm only if you check the order per
247
+ farm too. The transform repeats the join, adds the predictions on the row key, and marks
248
+ each row:
249
+
250
+ ```sql
251
+ select f.farm_id,
252
+ cast(f.hour_utc as timestamp with time zone) as hour_utc,
253
+ cast(f.wind_speed_100m_ms as double) as wind_speed_100m_ms,
254
+ cast(g.generation_mw as double) as generation_mw,
255
+ cast(p.prediction as double) as predicted_generation_mw,
256
+ cast(p.p10 as double) as predicted_generation_mw_p10,
257
+ cast(p.p50 as double) as predicted_generation_mw_p50,
258
+ cast(p.p90 as double) as predicted_generation_mw_p90,
259
+ p.model,
260
+ cast(p.trained_through as timestamp with time zone) as trained_through,
261
+ case when g.generation_mw is not null and p.prediction is not null then 'both'
262
+ when g.generation_mw is not null then 'measured'
263
+ when p.prediction is not null then 'predicted'
264
+ else 'none' end as value_status
265
+ from farm_forecast f
266
+ left join farm_generation g
267
+ on g.farm_id = f.farm_id and cast(g.hour_utc as timestamptz) = cast(f.hour_utc as timestamptz)
268
+ left join generation_forecast p on p.farm_id = f.farm_id and p.hour_utc = f.hour_utc
269
+ ```
270
+
271
+ `trained_through` is the training `order_by` value, so it is spelled as `hour_key` is, and the
272
+ cast reads it as a time. Declare `rebuild` and `refresh` at the top of the recipe as step 9 says:
273
+ a promotion of either sibling recomputes the predictions.
274
+
275
+ ### A predict table over fixed inputs
276
+
277
+ When no input will change again, such as a file read once or an upstream table that never
278
+ promotes again, a schedule only spends calls recomputing the same predictions. Build the table as
279
+ a fixed snapshot:
280
+
281
+ - Leave out `refresh`. Nothing rebuilds the table, so it needs no `rebuild` either.
282
+ - Build it once with `mr-data run --recipe RECIPE_ID --digest DIGEST --full`.
283
+ - Do not run `mr-data promote --cadence`. That cadence arms a fallback schedule, and every
284
+ rebuild it starts spends a call.
285
+ - Confirm `mr-data table TABLE_ID` shows no schedule.
286
+ - Record the decision with `mr-data dataset note DATASET_ID --heading "Fixed snapshot: no
287
+ refresh" --markdown-file NOTE.md`. Name each fixed table in backticks in the note
288
+ ([promote](promote.md)). Then skip the delivery block's cadence step and the allowance
289
+ arithmetic, and say so in one line each.
290
+
291
+ When the inputs start changing later, revise the recipe with `rebuild` and `refresh`, and set
292
+ the cadence then.
293
+
104
294
  ### Fit the daily allowance
105
295
 
106
296
  Every attempt is one call, retries included. Every table of the workspace draws on the same daily
@@ -131,8 +321,9 @@ build only the backtest.
131
321
  A worst case over the allowance runs it out during the day, and the table is held until
132
322
  00:00 UTC. An interval of 3600 with three predict sources spends 72 to 144 calls a day, so
133
323
  compare that with `quota.daily_calls` before you choose it. Every table in the workspace shares
134
- the allowance, so count them all. Write the interval and the arithmetic in the `promote --why`
135
- text, so the next reader sees why the table rebuilds as it does.
324
+ the allowance, so count them all. For a table that refreshes, write the interval and the
325
+ arithmetic in the `promote --why` text, so the next reader sees why the table rebuilds as it does.
326
+ A table over fixed inputs spends no call after its build and has no arithmetic to write.
136
327
 
137
328
  When the allowance is spent, a rebuild fails `PLATFORM_CREDENTIAL_QUOTA_EXHAUSTED` and sends
138
329
  nothing. The table keeps its last good version, and its refresh is held until 00:00 UTC. The
@@ -151,7 +342,8 @@ or a zero-padded number qualifies; `9` and `10` do not.
151
342
 
152
343
  A table source spells an upstream `timestamp with time zone` as `2026-10-01T00:00:00+00:00`, and
153
344
  it drops the fraction of a second when it is zero, so a column with some fractions has two
154
- lengths. Do not guess the spelling. Make the key yourself in the upstream table:
345
+ lengths. Do not guess the spelling. Make the key yourself, in `prepare.sql` as the worked example
346
+ does, or in the upstream table:
155
347
 
156
348
  ```sql
157
349
  select strftime(hour_utc, '%Y-%m-%dT%H:%M:%SZ') as hour_key,
@@ -169,15 +361,16 @@ boolean reaches the filter as text too, so do not filter on it bare.
169
361
  ### Check it honestly
170
362
 
171
363
  Evaluate a prediction before you present it, and before you register the live predict table.
172
- Build a separate backtest table once, as one `full` run with no `refresh`, from the same source,
173
- or the same upstream table when there is one:
364
+ Build a separate backtest table once, as one `full` run with no `refresh`, from the same
365
+ siblings and the same `prepare`, or the same upstream table when there is one. Only the filters
366
+ change:
174
367
 
175
368
  - **Split by time** for anything ordered in time. Training ends at a cut-off. The test rows are the
176
369
  labelled rows after it, at least four weeks for hourly data. A random split over time leaks the
177
370
  future into training and flatters the model.
178
371
  - **Split by a fixed key** for data with no time order, such as one row per diamond. A random
179
372
  holdout is fine there, but draw it once. Make a number from a column that names the row and
180
- never changes, and set each row's role from that number in the upstream table:
373
+ never changes, and set each row's role from that number in `prepare.sql` or the upstream table:
181
374
 
182
375
  ```sql
183
376
  with keyed as (
@@ -210,15 +403,20 @@ or the same upstream table when there is one:
210
403
 
211
404
  The backtest table's transform puts one test row beside every baseline, so people can read the
212
405
  comparison and anyone can recompute the numbers. Here the cut-off is 2023-10-25, the predict
213
- source is `generation_forecast`, and every join and average is per farm:
406
+ source is `generation_forecast` from the worked example, and every join and average is per farm.
407
+ The transform repeats the preparation's join, since it cannot read the prepared rows:
214
408
 
215
409
  ```sql
216
410
  with hours as (
217
- select farm_id, hour_key, cast(hour_utc as timestamp with time zone) as hour_utc,
218
- cast(generation_mw as double) as generation_mw,
219
- cast(wind_speed_100m_ms as double) as wind_speed_100m_ms,
220
- cast(hour_of_day as integer) as hour_of_day
221
- from farm_hours),
411
+ select f.farm_id, f.hour_utc as hour_text,
412
+ strftime(cast(f.hour_utc as timestamptz) at time zone 'UTC', '%Y-%m-%dT%H:%M:%SZ') as hour_key,
413
+ cast(f.hour_utc as timestamp with time zone) as hour_utc,
414
+ cast(g.generation_mw as double) as generation_mw,
415
+ cast(f.wind_speed_100m_ms as double) as wind_speed_100m_ms,
416
+ extract(hour from cast(f.hour_utc as timestamptz) at time zone 'UTC') as hour_of_day
417
+ from farm_forecast f
418
+ left join farm_generation g
419
+ on g.farm_id = f.farm_id and cast(g.hour_utc as timestamptz) = cast(f.hour_utc as timestamptz)),
222
420
  train as (select * from hours where generation_mw is not null and hour_key < '2023-10-25T00:00:00Z'),
223
421
  hour_mean as (select farm_id, hour_of_day, avg(generation_mw) as mean_mw from train group by 1, 2),
224
422
  fit as (select farm_id, regr_slope(generation_mw, wind_speed_100m_ms) as slope,
@@ -232,7 +430,7 @@ select h.farm_id, h.hour_utc, h.generation_mw,
232
430
  m.mean_mw as hour_of_day_mean_mw,
233
431
  greatest(0, fit.intercept + fit.slope * h.wind_speed_100m_ms) as linear_fit_mw
234
432
  from generation_forecast p
235
- join hours h using (farm_id, hour_key)
433
+ join hours h on h.farm_id = p.farm_id and h.hour_text = p.hour_utc
236
434
  left join hours day_before
237
435
  on day_before.farm_id = h.farm_id and day_before.hour_utc = h.hour_utc - interval 24 hour
238
436
  left join hour_mean m on m.farm_id = h.farm_id and m.hour_of_day = h.hour_of_day
@@ -283,11 +481,12 @@ A person can ask for the predictions in the same table as their data. Build it t
283
481
  on the row key, so one table holds the original columns and the prediction columns together.
284
482
  Present it as prediction columns added to the person's table, not as a new table. On a table
285
483
  that is already live, adding them is a recipe revision and a full resync: ask first.
286
- - **Prepare features upstream.** Predict reads a source's rows before the transform runs, so it
287
- cannot read a join or a derived column the same table makes. Build that preparation as its own
288
- upstream table and carry its columns through, so the main table is still the one to read. Say
289
- in one line that the upstream table is a supporting table. Search, the cover and the view go on
290
- the main table only.
484
+ - **Prepare the rows in the recipe.** Predict reads its rows before the transform runs, so it
485
+ cannot read a join or a derived column the transform makes. Make them in `prepare` instead
486
+ ([prepare the rows in the recipe](#prepare-the-rows-in-the-recipe)). Build a supporting upstream
487
+ table only when `prepare` cannot: the preparation is over prepare's limits, or other tables
488
+ need the same prepared rows. Say in one line that such a table is a supporting table. Search,
489
+ the cover and the view go on the main table only.
291
490
  - **Never overwrite the measured column.** Keep it as it is. Put the model's value in its own
292
491
  column named for the target, such as `predicted_generation_mw`, with one range column beside it
293
492
  per quantile you request (`predicted_generation_mw_p10`). Keep `model` and
@@ -301,8 +500,8 @@ A person can ask for the predictions in the same table as their data. Build it t
301
500
  and for anything ordered in time training ends before the first predicted row. Express it with
302
501
  the two filters on the key `order_by` names. For a comparison, filter `training` to
303
502
  `generation_mw is not null and hour_key < '2026-10-01T00:00:00Z'` and `rows` to
304
- `hour_key >= '2026-10-01T00:00:00Z'` with the features present. Live, filter `training` to
305
- `row_role = 'measured'` and `rows` to `row_role = 'ahead'` with the features present. After
503
+ `hour_key >= '2026-10-01T00:00:00Z'` with the features present. Live, filter `training` to the
504
+ measured rows and `rows` to a flag such as `is_ahead = 'true'` with the features present. After
306
505
  every rebuild, query that the earliest predicted row comes after the latest training row.
307
506
  With no time order, query that no row key is in both sets.
308
507
  - **Keep rows ahead at every rebuild.** A rebuild with no row to predict succeeds and seals no
@@ -316,29 +515,8 @@ A person can ask for the predictions in the same table as their data. Build it t
316
515
  gives the same values to a relative 1e-5 (1e-6 near zero), not the same bytes, so an unchanged request can still
317
516
  seal a new version.
318
517
 
319
- The transform step for a regression whose row key is the farm and the hour. Every source column is
320
- text, so cast each one:
321
-
322
- ```sql
323
- select d.farm_id,
324
- cast(d.hour_utc as timestamp with time zone) as hour_utc,
325
- cast(d.wind_speed_100m_ms as double) as wind_speed_100m_ms,
326
- cast(d.generation_mw as double) as generation_mw,
327
- cast(p.prediction as double) as predicted_generation_mw,
328
- cast(p.p10 as double) as predicted_generation_mw_p10,
329
- cast(p.p50 as double) as predicted_generation_mw_p50,
330
- cast(p.p90 as double) as predicted_generation_mw_p90,
331
- p.model,
332
- cast(p.trained_through as timestamp with time zone) as trained_through,
333
- case when d.generation_mw is not null and p.prediction is not null then 'both'
334
- when d.generation_mw is not null then 'measured'
335
- when p.prediction is not null then 'predicted'
336
- else 'none' end as value_status
337
- from farm_hours d left join generation_forecast p using (farm_id, hour_key)
338
- ```
339
-
340
- `trained_through` is the training `order_by` value, so it is spelled as `hour_key` is, and the
341
- cast reads it as a time.
518
+ The [worked example](#worked-example-two-siblings-one-table) shows the transform step that
519
+ joins the predictions back and sets `value_status`.
342
520
 
343
521
  Do not add prediction columns until the backtest has run. A model that loses to the baseline is no
344
522
  forecast: show the comparison instead, and offer the baseline.
@@ -383,17 +561,18 @@ still counts in `usage_today.calls` in `mr-data models --json`.
383
561
 
384
562
  | Code | What to do |
385
563
  | --- | --- |
386
- | `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. |
387
- | `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, or a column the upstream table no longer has. The detail says which. Fix it in the upstream table or the filters, or select rows whose features have arrived. |
388
- | `PREDICT_INPUT_EXCEEDS_LIMIT` | The request is over a binding limit. Lower `max_rows` or the feature count. |
564
+ | `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. |
566
+ | `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`. |
389
567
  | `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. |
390
568
  | `PREDICT_RESPONSE_INVALID` | The answer had the wrong shape. Run again once, then report it. |
391
569
  | `PREDICT_PLATFORM_AUTH_FAILED` | Mostly Right's configuration. Tell the person; there is nothing to fix in the recipe. |
392
- | `ARTIFACT_PERSIST_FAILED` | Mostly Right failed to save the result after the model answered. The fault is Mostly Right's, and the call was most likely spent. Do not retry: a retry spends another call and fails the same way. Tell the person, and report the run id to Mostly Right. Leave the recipe as it is. Once Mostly Right says it is repaired, start a new run with `mr-data run`, not `--retry`. |
570
+ | `ARTIFACT_PERSIST_FAILED` | Mostly Right failed to save the result after the model answered. The fault is Mostly Right's, and the call was most likely spent. Do not retry: a retry spends another call and fails the same way. Tell the person, and report the run id to Mostly Right. Leave the recipe as it is. Once Mostly Right says it is repaired and the person agrees to spend the call, rebuild with `mr-data run --retry RUN_ID --repaired`, naming the newest failed run of that recipe. That spends one more call. A plain `mr-data run` with the same recipe and digest returns the stored failure and queues nothing; its `next_command` names the newest failed run. |
393
571
  | `PLATFORM_CREDENTIAL_QUOTA_EXHAUSTED` | Today's allowance is spent. It renews at 00:00 UTC, and the table is held until then. Do not retry. On an ordinary day, raise `min_interval_seconds` ([fit the daily allowance](#fit-the-daily-allowance)). |
394
572
  | `PLATFORM_CREDENTIAL_UNBOUND` | At registration: the binding, model or origin is not the listed one, a `max_rows` or the feature count is over `predict_limits`, or the binding pins no model. The detail's pointer names the predict member to revise in the source that names that binding; revise it and register again. When it says no predict binding is in force, predicting is off here. |
395
573
  | `PLATFORM_CREDENTIAL_UNAVAILABLE` | A live table's binding changed or was switched off. Read `mr-data models --json` again, then revise the recipe or tell the person. |
396
574
  | `ROW_REQUEST_UNAVAILABLE` | The model was starting up or busy. Run again; a cold start takes 3 to 5 minutes. |
575
+ | `RUN_RECIPE_INVALID` on a recipe with `prepare` that registered | The build engine does not run `prepare` right now, such as during a rollback. Nothing in the recipe fixes it. Tell the person. After five such failures a refresh is held `REPEATED_FAILURE_HELD`; once `prepare` is back, refresh each held table by hand. While `prepare` is held back, registration refuses it at `/sources/N/predict/prepare` and a run answers `KEEL_ENGINE_REQUIRED`. |
397
576
  | `KEEL_ENGINE_REQUIRED` saying the simple run path is off | Mostly Right has paused predict runs. Nothing in the recipe fixes it. Tell the person, and run again when it is back on. |
398
577
  | Other `KEEL_ENGINE_REQUIRED` | Run again later, then report it. |
399
578
 
@@ -408,14 +587,17 @@ Tick each one, and report any you skipped with the reason:
408
587
  person, and said plainly if a baseline won.
409
588
  - [ ] The backtest table is kept as a named comparison table with its description, or demoted and
410
589
  archived. No `scratch_` table from this work is still live.
590
+ - [ ] The predictions are in the table people read. Its features are prepared with `prepare`,
591
+ or a supporting upstream table is kept because `prepare` cannot do it, and you said why.
411
592
  - [ ] The main table holds the measured column unchanged, `predicted_<target>` columns,
412
593
  `model`, `trained_through` and `value_status`.
413
594
  - [ ] A query shows the earliest predicted row is after the latest training row, or, with no
414
595
  time order, that no row key is in both sets.
415
- - [ ] `rebuild.min_interval_seconds` fits the allowance for every predict source in the
416
- workspace, and `promote --why` states the arithmetic.
417
- - [ ] The upstream table holds rows ahead at every rebuild, or the person knows when it has none.
596
+ - [ ] 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:
598
+ no `refresh`, no schedule, and a "Fixed snapshot: no refresh" note that names the table.
599
+ - [ ] A refreshing table holds rows ahead at every rebuild, or the person knows when it has none.
418
600
  - [ ] The dataset description passes the `delivery` check and describes every prediction column,
419
601
  the backtest and that predictions change at each rebuild.
420
- - [ ] The cover, search on the main table, its view and its cadence are done, as the `delivery`
421
- block lists them.
602
+ - [ ] The cover, search on the main table, its view and its cadence or fixed-snapshot note are
603
+ done, as the `delivery` block lists them.
@@ -62,7 +62,19 @@ and record the decision and its reason with
62
62
  Then skip the delivery block's cadence step, saying so in one line. The step stays listed, and
63
63
  the note is the record. A note that names tables, each name in backticks (`` `archive_2025` ``),
64
64
  covers only those tables; one that names none covers every table on the dataset. A table whose
65
- recipe declares `refresh.trigger: upstream_promoted`, or that a stream fills, needs no note.
65
+ recipe declares `refresh.trigger: upstream_promoted`, or that a stream fills, needs no note. Its
66
+ trigger still runs only after `promote --cadence` ([sources](sources.md)), and that cadence stays
67
+ a fallback schedule. So when its upstreams never change, treat it as a fixed snapshot: leave out
68
+ `refresh`, set no cadence, and write the note. A predict table over fixed inputs is the common
69
+ case, since every rebuild spends a call
70
+ ([predicting](predicting-with-tabular-models.md#a-predict-table-over-fixed-inputs)).
71
+
72
+ **Revise a note under its own cell id.** `mr-data dataset note DATASET_ID --list` prints each
73
+ cell's `cell_id`. Write the note again with `--cell-id CELL_ID` to revise it in place, under a
74
+ new heading if you like. Without `--cell-id` the id comes from the heading: the same heading
75
+ replaces that cell, and a new heading starts a new cell beside it. `--revise CELL_ID` names a
76
+ different cell the new one supersedes, such as a question now answered. Read `--list` before you
77
+ write a note whose heading may already be used.
66
78
 
67
79
  This call records a schedule; it is not proof of data continuation. Schedule only a current recipe
68
80
  that `mr-data recipe readiness --table TABLE_ID --current-only --json` reports as refresh-ready, or
@@ -540,7 +540,8 @@ Three rules cost a round trip when they are missed:
540
540
  - The upstreams must be in this workspace, promoted, not archived, and not this table. No edge may
541
541
  close a cycle.
542
542
  - The trigger runs only after the user chose updates with `mr-data promote --cadence`. That
543
- cadence stays the fallback schedule.
543
+ cadence stays the fallback schedule. When the upstreams never change, declare no `refresh` and
544
+ record a fixed snapshot instead ([promote](promote.md)).
544
545
 
545
546
  The full member list is in `docs/RECIPE-DOCUMENT.md`, "Needs server 4.38".
546
547